建议更加规范的数据格式
查看原帖
建议更加规范的数据格式
552
nodgd楼主2022/1/2 14:33

测试点77的文件末尾不是\n结尾,但其他测试点都是\n结尾。

(我用下面这份代码提交,测试点77是RE,其他是WA,就可以说明这一点)

#include <bits/stdc++.h>
using namespace std;
char s[5 << 20]; //5MB足够了,极限数据大约2.5MB
int main() {
    int len = fread(s, 1, 5 << 20, stdin);
    assert(s[len - 1] == '\n');
    return 0;
}
2022/1/2 14:33
加载中...