
无论是否开启 O2 优化均在 #3 #4 测试点 RE 。
评测记录:开启 O2 优化、未开启 O2 优化
以下为本蒟蒻对该代码做的测试。然后把疑问从自己的代码转向了洛谷评测机
洛谷线上 IDE 测试(#3 数据点数据)

经实验,无论是否开启 O2 优化均可以输出正确答案。
本地 Linux 环境测试(#3 数据点数据)

警告信息均为格式问题(换行和缩进,Vim 直接粘贴的锅)。
编译开关与洛谷在线评测系统的编译开关仅有两处不同:未使用 -DONLINE_JUDGE 定义 ONLINE_JUDGE 宏;增加 -fsanitize=address,undefined ,使用 Sanitizer 检测地址问题和未定义行为。Sanitizer 未报告错误。
ONLINE CPP 测试(#3 数据点数据)

编译开关完全遵照洛谷在线评测系统的编译开关。可以输出正确答案且无错误返回。
#include <iostream>
using namespace std;
struct big_int {
int num[65536], l;
} a, b, c;
big_int operator+(big_int a, const big_int& b) {
int i;
a.l = min(a.l, b.l);
for (i = 1023; i >= a.l || i >= b.l || a.num[i] || b.num[i]; --i) {
a.num[i] += b.num[i];
a.num[i - 1] += a.num[i] / 10;
a.num[i] %= 10;
}
a.l = ++i;
return a;
}
void read(big_int& a) {
char c;
int i = 0;
while (a.num[i++] = 0, i != 1024);
while (!(((c = getchar()) & 48) && c < 58)); a.num[--i] = c & 15;
while ( ((c = getchar()) & 48) && c < 58 ) a.num[--i] = c & 15;
a.l = i;
while (swap(a.num[i], a.num[(a.l|1024) - i - 1]), (++i) < ((a.l|1024) >> 1));
}
void print(const big_int& a) {
int i = a.l;
while (printf("%d", a.num[i++]), i != 1024);
printf("\n");
}
int main() { return read(a), read(b), print((c = a + b)), 0; }
蒟蒻求助 qwq 孩子已经被折磨疯了,救救孩子吧,玄二关