复赛注意事项
- 遇到不会做的题目不要慌,看数据范围(没准可以暴力),或者看部分分,尽可能多拿部分分,并且部分分有可能会对正解提供思路。
- 考试时发下解密密码后立刻将里面的文件解压,否则一不小心手残关掉后又得重新输浪费时间。
- 注意时空限制(看题目介绍,不一定是1s/256MB),千万不要MLE,可以考虑滚动数组(看情况),或者使用STL。
- 仔细读题,仔细读题,仔细读题!
- 不要套算法(lqy名言),认真分析后再打代码。
- 注意细节,考虑全面一点,注意“不开long long见祖宗”。
- -Wall , 注意边界。
- 大样例的使用方法:直接拷贝文件,用 fc 比较答案。
- 如果要观察数据,Dev-C++ 是一个很好的工具(比记事本好用!)它可以显示行列且ASCII字符长宽相同。
- 不要搞花里胡哨的东西,如超快读。
前六条及Windows对拍程序由学长 @剑路双痴 (不知情)友情贡献
我的比赛流程:
-
准备 测试电脑 编译选项 说明解压 通读题目,简化题意
-
思考 仔细读题 看部分分(30min) 写全步骤 举例边界
-
编写 模块调试 静态查错 ( 头文件 数字大小 计算内存! 变量类型 变量功能 执行步骤 ) 手造数据
-
收尾
留 5~15 分钟检查:文件夹、文件名、文本输入输出、注释、测试。
对拍
Windows对拍程序(不需要文件输入输出)
#include<cstdio>
#include<windows.h>
int cnt=0;
int main()
{
while (1)
{
printf("Case %d:\n",++cnt);
system("data.exe>test.in");
system("std.exe<test.in>test.ans");
system("tst.exe<test.in>test.out");
if (system("FC test.out test.ans")) break;
}
}Linux对拍程序(需要文件输入输出)
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i;
system("g++ ./rand.cpp -o rand");
system("g++ ./std.cpp -o std");
system("g++ ./test.cpp -o test");
for (i=1;; i++)
{
printf("The result of No. %d Case is: ",i);
system("./rand");
system("./std");
system("./test");
if (system("diff std.out test.out"))
{
printf("Wrong Answer\n");
return 0;
}
else printf("Accepted\n");
}
return 0;
}