USACO打怪升级(二): TEXT Submitting Solutions

     

      Submintting Solutions 是一篇TEXT,主要是教你如何在在USACO正确答题,主要描述的是USACO的一些编译环境,一些答题文件规范,和一些网站规则。

    Program submissions require simple Header comments: your ID (i.e., your USACO login name), the name of the program (which will be given in each programming assignment, and the language used. See the examples below to get the idea.
    这段话主要是说提交的程序需要一些头部注释,例如你的ID,也就是登录名,程序的名字,这个会在每个问题里相应给出,以及程序使用的语言。

  Every training page problem has input and output. Currently, the input appear   in a file named 'probname.in' (e.g., if the problem name is 'ride', then the input filename is 'ride.in'). Output must be written to a file named 'probname.out' (i.e., 'ride.out' for the 'ride' problem).

  每个问题都有相应的输入输出文件,每个问题的输入在实际的问题中会给出,一般是‘probname.in'的形式, 输出必须写到输出文件中,文件名为'probname.out'。

  以下是一个测试例子:

/*
ID: your_id_here
PROG: test
LANG: C++                  (<-- or C++11f you prefer)
*/
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main() {
    ofstream fout ("test.out");
    ifstream fin ("test.in");
    int a, b;
    fin >> a >> b;
    fout << a+b << endl;
    return 0;
}

注意,根据我的第一次答题经验,header comment 必须按照上面的样式进行填写,否则网站识别不了,就会一直报错。所以一定要注意。


The restrictions are few:
One second runtime limit unless other specified (700 MHz Pentium III)
About 16MB datasize limit
About 1MB stacksize limit
Be sure your program exits with status 0
Be sure you print complete lines (with terminating newline), not just a few words or numbers
Don't use files other than the specified input, output, and auxiliary files

Other common sense rules that need not be listed

这里是一些程序运行方面的限制,例如运行时间,堆栈大小等。

Don't try to cheat.
Don't just print the answers, you must calculate them in your program. If you just print answers, your login ID might be removed.
Don't try to look at other files on the system or use other schemes to break security
Don't try to break common sense rules of privacy
Please report anomalous behavior to me right away (<kolstad@delos.com>)
Have as much fun as possible
Earn a trip to the IOI and other exotic contests!
还有一些网站规则:包过不要作弊,不要仅仅是print anwers等等,

Some hints:
Both stderr and stdout are returned to you when errors occur
Feel free to ask questions and send in comments
Your reported output has `_'s substituted for spaces
Include this comment if you use try/catch/throw in C++: /*pragma handle-exceptions*/
Compiler comments (please send in new compiler comments as you find them):

We're using g++ (a.k.a. djgpp on PCs), Free Pascal, and gjc
In C/C++, ints are 32 bits (char is 8; short is 16; long is 32; long long is 64)
some libraries have new names; some have different or missing functions
stricmp doesn't exist; use strcmp for string compares
strrev does not exist
neither itoa nor ltoa exists (use sprintf instead)
No need for huge declarations - pointers already go everywhere
Pascal users: be sure to "close" your output file or the output might not appear
最后还有一些小建议和编译器的的细节。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值