跳到正文

剪贴板

剪贴板 9ve6rgcg

369Pai
原文
剪贴板信息

剪贴板信息

发布
收录
更新

复赛注意事项

  1. 遇到不会做的题目不要慌,看数据范围(没准可以暴力),或者看部分分,尽可能多拿部分分,并且部分分有可能会对正解提供思路。
  2. 考试时发下解密密码后立刻将里面的文件解压,否则一不小心手残关掉后又得重新输浪费时间。
  3. 注意时空限制(看题目介绍,不一定是1s/256MB),千万不要MLE,可以考虑滚动数组(看情况),或者使用STL。
  4. 仔细读题,仔细读题,仔细读题!
  5. 不要套算法(lqy名言),认真分析后再打代码。
  6. 注意细节,考虑全面一点,注意“不开long long见祖宗”。
  7. -Wall , 注意边界。
  8. 大样例的使用方法:直接拷贝文件,用 fc 比较答案。
  9. 如果要观察数据,Dev-C++ 是一个很好的工具(比记事本好用!)它可以显示行列且ASCII字符长宽相同。
  10. 不要搞花里胡哨的东西,如超快读。

前六条及Windows对拍程序由学长 @剑路双痴 (不知情)友情贡献

我的比赛流程:

  1. 准备 测试电脑 编译选项 说明解压 通读题目,简化题意

  2. 思考 仔细读题 看部分分(30min) 写全步骤 举例边界

  3. 编写 模块调试 静态查错 ( 头文件 数字大小 计算内存! 变量类型 变量功能 执行步骤 ) 手造数据

  4. 收尾

    留 5~15 分钟检查:文件夹、文件名、文本输入输出、注释、测试。

对拍

Windows对拍程序(不需要文件输入输出)

C++
#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对拍程序(需要文件输入输出)

C++
#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;
}