2021.6.5 校内模拟赛游记

首先庆祝 AK!

然后发现按照《OI 比赛事故和事故征候评定标准》及其精神,这场比赛同样构成了轻微事故征候,只是最后 happy ending 了而已。

有点像 FM9246(错误连接 VOR,差点 CFIT,幸亏天气 CAVOK)。

事件经过

  • 北京时间 6 月 5 日上午八时(0000Z)比赛开始
  • 0009Z 完成 A 编写
  • 0012Z 完成提交前检查单,但未执行备份操作
  • 0038Z 完成 B 题编写
  • 0045Z 在执行检查单过程中发现错误
  • 0047Z 证实是人工计算错误
  • 0048Z 完成检查单,但同样未执行备份操作
  • 0144Z 完成 C 题编写
  • 0146Z 开始对拍,此时才第一次想起需要备份
  • 0213Z 因为发觉被野花骗了,前导 00 是需要的而回滚
  • 0226Z 完成检查单

在 ABC 完成之后都未按照标准操作程序进行备份,只在 C 题对拍之前想起来应该备份,而且在比赛开始后两小时十三分使用了回滚,如果没有想起需要备份,这次回滚将无法成功。

同时,C 题没有思考清楚,在写完之后调试了较久的时间,且依赖对拍来发现错误,没有考虑到前后奇偶的变化,在被野花骗之后没有仔细分析,最终在比赛结束前 66 分钟才完成检查单。

构成轻微事故征候。

建议

  1. 严格落实标准程序要求,不能安全意识淡薄。
  2. 进行较大规模的改动前应证实问题,比如在这题中只需要让暴力来输出一下方案就可以了。

其它

花居然不写 SPJ 来卡精度??

不行,得自己写个 SPJ!

改了一份网上的 SPJ 代码,是比较九位浮点数的,放在这里备用吧。

#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;
string answer,output;//标准输出和选手输出
FILE* fout, *fans, *flog;
string In, Out, Ans, Log;
void End(const string& info, double x, int state = 0){
    fprintf(flog, "%.3lf\n%s\n", x, info.c_str());
    exit(state);
}
void Open(){
    if (Log.size()) flog = fopen(Log.c_str(), "w"); else flog = stdout;
    if (flog == NULL) exit(1);
    if ((fans = fopen(Ans.c_str(), "r")) == NULL) exit(1);
    if ((fout = fopen(Out.c_str(), "r")) == NULL) exit(1);
}
bool check(string a, string b) {
	for(int i = 0; i < min(9, (signed)b.size()); i++) 
		if(a[i] != b[i]) return true;
	return false;
}
int main(int argc, char* argv[]){
    In = "";
    Ans = argc < 3 ? "" : argv[2];
    Out = argc < 4 ? "" : argv[3];
    Log = argc < 5 ? "" : argv[4];
    //Ans和Out变量存储的是标准答案和选手答案的路径
    Open();//初始化,这句很重要。
    freopen(Ans.c_str(),"r",stdin);//重定向到标准输出
    cin >> answer;//读入
    freopen(Out.c_str(),"r",stdin);//重定向到选手输出
    cin >> output;//读入
    if (check(answer, output)){
        End("与标准答案相差过大",0);   
    }else{
        End("",1);   
    }
    return 0;
}