acm中 presentationacmruntime errorr 是怎么回事

3221人阅读
暑假ACM训练(3)
&FAQ:(Remember to use Ctrl+F) 从今天起,我会把在joj和bbs上回答的问题总结后贴出来。暂时先写这么多,会不停的更新,希望新手问问题之前先查一查.也希望大家能够补充,我会注明出处的!1ASK:1001 的循环怎么结束啊?REP:while(cin&&a) 读到文件结束时(EOF)会自动结束{}2 ASK:不知道什么会 runtime error#include&stdio.h&int main(){int i,j,n,m,s,a[10][10];while(scanf(&%d %d&,&m,&n),m&&n){for(i=0;i&m;i++)for(j=0;j&n;j++)scanf(&%d&,&a[i][j]);s=a[0][0];for(i=0;i&m;i++)for(j=0;j&n;j++)if(s&a[i][j])s=a[i][j];printf(&%d&,s);}}REP:题目数据可能会比较大,所以应该写成a[103][103]3ASK:2003第一组sample output第三行, 第三列,是1/8,为什么不是0.13而是0.12???REP:根据编译器的不同,可能会把0.13算成0.1299999...所以成了0.12,所以不用理会他,只要算法没问题就行4ASK:为什么会wa啊REP:wjiang:出现wa,那就是你有些地方没有考虑到,或者是代码有错误(正好这个错误在题目给你的测试数据中没有表现出来),你就要仔细的读题目,别落下什么有用的信息,再仔细的读你的代码,然后自己写一些测试数据,特别是边缘的数据来测试。我也经常碰上这样的问题,特别的闹心,不过通过了又会特别的高兴。5ASK:能控制输入数据小数位数吗REP:/*下面两个得同时用才行,其中x代表小数位数*/cout.setf(ios::fixed);cout.precision(x);6ASK:我怎么总是出现 compile error?REP:Siyee:近来发现joj上来了很多新手,with many compilation errors,所以提醒一个问题:submit页面中需要“粘贴”源程序,而不是直接写。可以事先用任何一个C++ IDE(集成开发环境,比如vc, c++builder等)。在用IDE时,需要创建控制台程序(console,而不是windows程序)。控制台程序一般只包含一个文件:*.cpp,其中的格式大致为:#include.......int main(void){...}在IDE中编译调试通过后,觉得没问题了,再复制粘贴到submit页面中进行提交。可以通过点击runtime error和compilation error来查看具体信息。 点击compilation error,可以看到提示信息。机器不同、操作系统不同、编译器不同、编译选项不同都可能造成编译结果不同。joj的编译选项比较严格,既不允许有error,也不允许有warning。7ASK:当程序wa了之后,我发现我根本没有好的调试方法,最多是插入一些输出语句看看中间变量的情况,然后对着屏幕发呆,如果题目要求的数据量不大的话,我甚至打出所有结果,然后挨个查,最后发现往往是某个临界值错了这样就耗了一两小时。。。有什么更好的方法呢?REP:evilll :我都是用f5,f10和f11来配合.uhunter vc中有debug功能,你可以设置断点,可以单步调试,比较方便F9:在光标处插入断点F11:运行到下一个断点处F10:执行一条语句你可以试试看可以看执行过程中变量值的变化来判断程序是否朝着自己预期的方向执行而devcpp的调试功能15:07 似乎不如vc方便...果然, 按着断点里面的语句走,变量值变化的很清晰。以前一进入debug环境头就大,因为一弄就全是汇编语言就一直用土方法,挨了那么多道题。。。。8:ASK:相同的题目是否每次提交时的测试数据都相同?有时提交同样的代码,第一次 超时 第二次就好了 是否只是服务器的速度的原因还有没有别的原因,比例说 每次提交时的测试数据不一样?REP:walkoncloud :题目所给的最大时间,通常都比标准程序所需要的时间大得多得多。如果你的程序刚好不超时通过,就说明的你的程序运行时间还是太多,还需要修改。一个不超时的程序(哪怕是错误的)编译运行是很快的。但如果一个同学把超时的程序反复提交,其他同学就会感觉服务器很慢。服务器运行在一个Linux之上,进程运行的时间受那个时刻系统负载大小、用户多少、运行的其它任务等因素影响,不可能每次都时间一样的。当然,更快些的服务器会好些,但需要好多money。9ASK:JUDGE TYPE Special 是什么意思?REP:使用程序而不是简单的文件比较来判断对错。skywind:如不限次序的输出lzr:同一测试数据可能有多个输出测试,与任意相同即可10ASK:用什么可以看程序的执行时间呀?REP:加代码的话加这些:#include&iostream&#include&ctime&int main(){time_t begin,begin=clock();//your code(此处输入自己的代码!)end=clock();cout&&&runtime: &&&double(end-begin)/CLOCKS_PER_SEC&&}11ASK:能在DOS下编译C 程序吗?REP:Siyee没学过编译,有些概念容易混淆。简单地说编译:把源程序“翻译”成目标程序编译器:执行编译任务的程序IDE:Integrated Development Environment,集成开发环境,“集成”是指将编辑、编译和调试“集成”在一起,可以通过统一的界面完成。例如:Visual Studio是IDE的集合,VB,VC是IDEgcc是C语言编译器g++是C++语言预处理器(将C++转换成C,再调用gcc)gdb是调试器,只要可执行文件中有调试信息即可,不仅限于C/C++一个简单的IDE:用notepad写C代码,然后用gcc编译,用gdb调试!无论是什么“器”都是程序而已。DOS、Linux、Windows是OS(操作系统),即执行程序的平台,能否在某平台下编译C程序取决于该平台下是否有C程序的编译器,事实上都有。编译器属于系统软件,任何OS都应当具有编译器。12ASK:数组开的不够大,为什么错误不是re,而是wa呢?REP:Siyee1. re = runtime error, 言外之意是送入CPU的指令发生异常2. 数组越界 = 访问了数组外的空间3. 数组外的空间可以是指令空间,也可以是数据空间4. 指令被更改不一定会发生re,因为更改后的指令很可能也是有效的5. 因此,数组越界 != re6. 这也是为什么不允许用gets的原因12ASK:请问如何买代码?REP:首先进入题目的status里面,然后看下面列举的状态里那个代码你想买,点击go,然后点击代码前面的运行号就行了!13ASK:请问cout.setf有什么用?REP:实数输出默认是浮点数的一般格式,最多显示六位有效位,setprecision(n)规定总有效位数,但小数最末的0是不显示的.setiosflags(ios::fixed)或者直接fixed实现定点输出,小数点后默认恒定6位有效数字,setprecision(n)规定小数点后有效位数.小数最末的0显示! setiosflags(ios::scientific)或者直接scientific实现指数输出,小数点后默认恒定6位有效数字.setprecision(n)规定小数点后有效位数.&例:double d=;&&&&&& cout&&d&&endl&&setprecision(10)&&d&&endl&&fixed&&d&&endl&&setprecision(5)&&d&&endl&&scientific&&d&&endl&&setprecision(10)&&d&&输出 12345.723461.21.e+004 标程:NOTE:许多标程都是收集来的,在这里仅供大家参考,我只是希望大家不要仅仅通过提交标程来增加ac题目数量,至少你要会比葫芦画瓢,其次是理解,以至写出更好的代码:)&<span style="font-size:18color:#:&C标程#include&stdio.h&int main(){&&&&&& double in,sum=0;&&&&&& while( scanf(&%lf&,&in) != EOF )&&&&&&&&&&&&& sum+=&&&&&& printf(&%.15g\n&,sum);&&&&&& return 0;}&C++标程#include&iostream&int main(){&&&&&& double in,sum=0;&&&&&& while( cin&&in )&&&&&&&&&&&&& sum+=&&&&&& cout.precision(15);&&&&&& cout&&sum&&&&&&&& return 0;}&<span style="font-size:18color:#:C标程#include&stdio.h&#include&string.h&#define N 1000int main(){&&&&&& int i,j,k,n;&&&&&& int flag=0;&&&&&&& while(scanf(&%d&,&n),n){&&&&&&&&&&&&& if(flag) printf(&\n&);&&&&&&&&&&&&& else flag=1;&&&&&&&&&&&&&& for(i=0;i&n;i++)&&&&&&&&&&&&&&&&&&&& printf(&%c&,'a'+i%26);&&&&&&&&&&&&&& printf(&\n&);&&&&&&&&&&&&& for(j=0;j&n-2;++j,++i){&&&&&&&&&&&&&&&&&&&& for(k=0;k&n-j-2;k++)&&&&&&&&&&&&&&&&&&&&&&&&&&& putchar(32);&&&&&&&&&&&&&&&&&&&& printf(&%c\n&,'a'+i%26);&&&&&&&&&&&&&& }&&&&&&&&&&&&&& for(j=0;j&n;j++){&&&&&&&&&&&&&&&&&&&& printf(&%c&,'a'+i%26);&&&&&&&&&&&&&&&&&&&& i++;&&&&&&&&&&&&& }&&&&&&&&&&&&& printf(&\n&);&&&&&&& }&&&&&& return 0;}&<span style="font-size:18color:#标程#include&stdio.h&char ans[1000101];int main(){&&&& &&&&&& int i,sum,&&&&&& for(i=1;i&=1000000;i++){&&&&&&&&&&&&&& if(!ans[i])& printf(&%d\n&,i);&&&&&&&&&&&&&& temp=sum=i;&&&&&&&&&&&&& while(temp!=0){&&&&&&&&&&&&&&&&&&&& sum=sum+temp%10;&&&&&&&&&&&&&&&&&&&& temp/=10;&&&&&&&&&&&&& }&&&&&&&&&&&&& ans[sum]=1;&&&&&& }&&&&&& return 0;}&<span style="font-size:18color:#标程#include&stdio.h&int Array[21][21][21];&int w(int a,int b,int c){&&&&&& if(a&=0||b&=0||c&=0) return 1;&&&&&& else if(a&20||b&20||c&20) return w(20,20,20);&&&&&& else if(Array[a][b][c]) return Array[a][b][c];&&&&&& else if((a&b)&&(b&c)) return Array[a][b][c]=w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,c);&&&&&& else return Array[a][b][c]=w(a-1,b,c)+w(a-1,b-1,c)+w(a-1,b,c-1)-w(a-1,b-1,c-1);}&int main(){&&&&&& int a,b,c;&&&&&& while(scanf(&%d%d%d&,&a,&b,&c),a!=-1||b!=-1||c!=-1)&&&&&&&&&&&&& printf(&w(%d, %d, %d) = %d\n&,a,b,c,w(a,b,c));&&&&&& return 0;}&<span style="font-size:18color:#标程&组合数学公式:#include&stdio.h&int main(){&&&&&&&& int m,n,k,p;&&&&&&&& while(scanf(&%d%d&,&m,&n)&&m){&&&&&&&&&&&&&&&& double d=1.0;&&&&&&&&&&&&&&&& k=m;p=n;&&&&&&&&&&&&&&&& if(n&m/2) n=m-n;&&&&&&&&&&&&&&&& while(n){d=d*m/n;m--;n--;}&&&&&&&&&&&&&&&& printf(&Binom(%d, %d) = %.0lf\n&,k,p,d);}} 动态规划:#include&iostream.h&void main(){&&&&&&&& int i,j,a[35][35];&&&&&&&& for(i=0;i&31;i++)&&&&&&&& {&&&&&&&&&&&&&&&& a[0][i]=1;&&&&&&&&&&&&&&&& a[i][0]=1;&&&&&&&& }&&&&&&&& for(i=1;i&31;i++)&&&&&&&&&&&&&&&& for(j=1;j&31;j++)&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&& a[i][j]=a[i-1][j]+a[i-1][j-1];&&&&&&&&&&&&&&&&&&&&&&&&& if(i==j)a[i][j]=1;&&&&&&&&&&&&&&&& }&&&&&&&&&&&&&&&& cin&&i&&j;&&&&&&&&&&&&&&&& while(i||j)&&&&&&&&&&&&&&&& {&&&&&&&&&&&&&&&&&&&&&&&&& cout&&&Binom(&&&i&&&, &&&j&&&) = &&&a[i][j]&&&&&&&&&&&&&&&&&&&&&&&&&&&& cin&&i&&j;&&&&&&&&&&&&&&&& }}  TOCIntroduction Getting Started Exchanging Source Codes Contacting Other JOJers Enjoying Contests Ranklist Frequently Asked Questions Introduction Welcome to Jilin University Online Judge System (JOJ). It's one of the best online judge systems in China and the training ground for the ACMers in Jilin University . JOJ now provides up to 1000 problems and still collects more. Back To Top Getting Started Register Before you become a jojer, you have to register for an account. Click on the Register on the main menu then fill in a short form, you are done. Choose and solve your first problem There are two ways for you to choose a problem. Click on Problems on the main menu, and choose one problem from the problem list. The list can be sorted by the problem ID (default), the ratio, the number of accepted runs or the number of total submits. Simply click on the ID, Ratio, Accepted, or Submit on the head of problem list. (You can start by 1000). If you want to choose a specific problem, you can also use the search problems function on the main menu. After choosing your problem, you should first write your code (in Pascal or C++) locally on your own computer and tested it using your favorite IDE. When you are sure of the correctness of your code, submit your source code to the judge by clicking submit. Status after submitting After submitting your code, you will be redirected to the status page in 3 seconds where you will see the status in the following format: RID &PID &Author &Status &Code &Lang &Date & Time &73010 &1000 &Lionheart &Accepted (0.00s 414K +0+0 ) &184 Bytes &C++ & 13:56:48 &RID: The ID for the submit. By clicking it, you will have the access to the source code of the submit, but you have to first pay for it if it's not submitted by you. (See More Details) PID: The problem ID. Author: The submitter ID. After you've clicked it, the author's status's page will appear. Code: The length of the code. Lang: The language used in the submitted source code. Status: The status indicating the time your program has run, the memory your program has consumed, the Jpoints you have gained and whether your code is accepted by the judge or not. It will be one of the following: Type of Wrong Messages &Meaning &Wrong Answer &Your program makes wrong answer. That's probably caused by wrong algorithm or misunderstanding of the problem. &Presentation Error &The output format is wrong. You should read the output specification of the problem again and check the output part of your program. &Runtime Error &It means your program halted down during runtime. Possibly it's caused by dividing by zero or array outranging (invalid memory access). &Time Limit Exceeded &It means the running time of your program exceeded the time limit of the problem. You should change another algorithm or make your program optimized. &Memory Limit Exceeded &It means the memory consumed of your program exceeded the memory limit of the problem. You should change another algorithm or make your program optimized. &Output Too Much &It means the output of your program is too much. Maybe it's caused by misunderstanding of the problem. Check if your program terminates? &Compilation Error &That is a very stupid error. No matter what kind of IDE you are using, you should always use the standard C/C++ library (or reference). &Judge Error &Maybe there is something wrong with the judge or the server. Please contact me as soon as possible. &You should fix your program according to the first 5 of above 6 wrong messages while it is me who is always responsible to the last wrong message, say JUDGE ERROR. Besides, there are other accessory messages which also mark the status of the run of your program. Here they are: Type of Other Messages &Meaning &Accepted &Congratulations! Your program has been accepted by the judge. You should then choose another program to solve. &Waiting &It means the server is busy and the judge hasn't processed your request. You should wait for a while patiently. Remember do not submit your program again. The judge will process your program soon. &Compiling &It means your program is being compiled on the server. &Compilation OK &It means your program has just been compiled without errors and prepares to run. &Running &It means your program is running on the server. &Back To Top Source Code Exchanging It's possible to buy other authors' source codes using Jpoints on JOJ. Collecting Jpoints Generally, Jpoints are collected when the judge has accepted your solution for a specific problem for the first time. You will also receive extra Jpoints, if you win a contest, some other people have bought your code, you are among the first five people who successful solved a specific problem or you are solving problem in numeric order. Details: You will receive X+Y Jpoints for each accepted submit, where X is the basic Jpoints and Y is the addition reward. X=10+T, if you are among the first five successful submitter to the problem, say you are the nth submitter, t = (5-n+1). If you successfully solved n problems consequently, y=min (10, n). While in Contest, X will equal to 30. Pricing of a source codeThe cost of a source code may vary due to the number of accepted runs for the problem. It can be calculated by the following formulas: Cost (For the buyer) = MAX (100,200- 1.15^n), where n is the number of accepted submitters. Gain (For the owner) = cost * %3 Accessing to a source code You may access to a source code by clicking its RID. If you want to view the code you have already purchased, simply click on the number indicating the number of Jpoints you have to open trade log. Note: you won't have to pay again for the same RID. &Closing/Reopening your source code If you don't want other authors to see your code, you may close one or all of your source codes. Simply access to the code you want to close and click on “Close this source code” or “Close all source code”. Of course, source code can be reopened in this way too. Please Note: all codes are open by defaults. Back To Top Contacting other JOJers You can contact other JOJers using sender or Email. Sender is the messaging service provided by JOJ. Click on “Sender” on the author's status page will open the sender addressing to that author provided the author's sender hasn't been closed, while the name on author's status page is linked to the email address of the author. Back To Top Enjoying Contests JOJ sometimes holds contests. You will find competing in contest is real fun. Entering a contest When the contest has started, you can join the contest by clicking on the Contest on the main menu. Please Note: You have to submit under contest system, namely, access problems directly from the CONTEST PAGE!!! You can't purchase others' solution to the contest problem during contest. Scoring There are two components to a team's score. The first is the number of problems solved. The second is penalty points, which reflects the amount of time and incorrect submissions made before the problem is solved. For each problem solved correctly, penalty points are charged equal to the time at which the problem was solved plus 20 minutes for each incorrect submission. No penalty points are added for problems that are never solved. So if a team solved problem one on their second submission at twenty minutes, they are charged 40 penalty points. If they submit problem 2 three times, but do not solve it, they are charged no penalty points. If they submit problem 3 once and solve it at 120 minutes, they are charged 120 penalty points. Their total score is two problems solved with 160 penalty points. The winner is the team that solves the most problems. If teams tie for solving the most problems, then the winner is the team with the fewest penalty points. Back To Top Rank List Wanna check out how well you and others are doing? Go to the Rank List. Back To Top Frequently Asked Questions Q: I have successfully tested my source code on my PC, but I got a compiler error after submission. Why? A: If you are using C++, you are experiencing compatibility problems of C++. Please change a compiler. G++ and VC.NET are strong recommended. Q: What most probably caused “Runtime Error”? A: You will get a “Runtime Error”, if you are trying to visit a pointer that points to an invalid address/ your array has overflowed/your program returned non-zero. Q: How to control precision in C++? A: cout.precision() can be used to control precision. Remember, if you want to use fixed numeric format. Add cout.setf(ios::fixed) to your code, because the scientific numeric format is the default of C++. Check out PID 1020. Q: Why is gets() forbidden?A: Gets() is a dangerous function. Please try using getline(), getchar() instead.
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:4811次
排名:千里之外校内ACM上出现Presentation Error的一点认识 - 博客频道 - CSDN.NET
分类:NYOJ
首先可以肯定的是,你的思路没有错,输出结果也与标准输出结果非!常!接!近!出现这个错误最可能的原因是,在输出结果的后面,多了或少了没什么意义的空&#26684;,tab,换行符等等。所以,请先认真检查程序的输出结果是否与标准完!全!一!致!OJ平台对&#26684;式的检查可以说是非!常!严!&#26684;!
如果认真检查过,真的没有问题的话,唯一的可能,就是标准输出结果存在问题!标准的输出结果后面有些你看不见的空&#26684;或者换行符!加个空&#26684;或换行符再试一试!
排名:千里之外
(61)(8)(4)(0)(2)(4)(22)(3)(3)(2)(1)(1)(1)(1)(3)ACM错误提示、常见问题
F.A.Q.(Chinese)
我的程序为什么不能编译通过呢?
Online Judge
要求C/C++程序符合Ansi标准:
ANSI 标准和 Microsoft Visual C++ 存在一些不同的地方,比如:
0)& main函数必须声明为int ,也就是 void main() 必须变成
int main()
VC同样可使用int main,只是程序最后需要 return 0;。
1)& Microsoft Visual C++ 可以将 main 函数声明为 void,而
ANSI 中必须为 int main
2)& 请避免使用如下方式声明变量i
for (int i=0; i&10; i++)
您可以在For 语句之前,进行声明。
3)& itoa 不是一个 ANSI 函数
4)& stricmp 不是一个 ANSI 函数
5)& sqrt() 的可能用法:& sqrt(double
(x)); //强制转换为double
6)& OnlineJudge 中如何使用64位数?
定义64位数使用 long long 类型,输出格式串中使用 %lld 表示64位数。
虽然Free Pascal尽量设计得和Turbo
Pascal接近,但是由于以下的两个原因,两者之间还是有一些区别的:
1.Free Pascal是一个32位的编译器,而Turbo Pascal只是16位编译器;
2.Free Pascal是一个跨平台的编译器,而Turbo Pascal只在windows上使用。
如果你的代码是遵守ANSI Pascal的,那么代码从Turbo Pascal移植到Free Pascal是没有问题的。
下面是在Turbo Pascal上可以使用,但是在Free Pascal就不能使用的一些语言特性:
函数和过程在使用时,参数的类型必须和定义时完全一致。原因是在Free Pascal中添加了函数重载功能。
PROTECTED,PUBLIC,PUBLISHED,TRY,FINALLY,EXCEPT,RAISE成为了关键字,因此不能作为函数和过程的名字。
3.&& FAR,NEAR不再是关键字了。原因是Free
Pascal是32位系统,不再需要这些关键字。
布尔表达式不一定要全部进行计算。只要最终结果已经能够确定,就不再计算其它还没有计算的部分了。
比如布尔表达式exp1 AND exp2 AND exp3,如果已知exp1的结果是false,
那么怎么表达式的结果肯定是false,exp2和exp3就不用进行计算了。
5.&& 在Free
Pascal中,集合中的元素都是4个字节长的。
表达式执行的顺序是不确定的。比如对于表达式a:=g(2)+f(3); 不保证g(2)一定在f(3)之前执行。
如果用Rewrite打开文件,那么文件就只能被写入了。如果需要读取这个文件,要对文件执行Reset。
8.&& Free
Pascal在程序结束之前一定要关闭输出文件,否则输出文件可能不能被正确的写入。
9.&& Free
Pascal理论上可以使用4GB的内存,因此实际上几乎可以使用系统中的所有剩余内存(除非赛题中有内存限制)。
这是Free Pascal由于32位的编译器。但是对于Turbo Pascal来说,由于是16位的编译器,
因此不能定义大小超过64KB的数据类型和变量,并且在DOS实模式下可以使用的内存总数只有640KB。
Online Judge 评判结果分别表示什么意思?
当你提交的程序被Online
Judge评判完毕后,通常结果将立刻返回,或者你也可以在“Solutions”页看到评判结果。
详细测试多数据测试模式下,将显示出各个测试数据的测试结果,并且无论结果如何,都会用所有测试数据进行测试。
而一般多测试模式下,如果全对,则为Accepted;若其中某次数据出错,则评测中止,并返回此数据出错的信息。
常见的Online Judge将评判结果分为如下几类:
   程序的输出完全满足题意,通过了全部的测试数据的测试。
Wrong Answer
   你的程序顺利地运行完毕并正常退出,但是输出的结果却是错误的。
   注意:有的题包含多组测试数据,你的程序只要有一组数据是错误的,结果就是WA。
Presentation Error
   你的程序输出的答案是正确的,但输出格式不对,比如多写了一些空格、换行。
   请注意,大部分程序的输出,都要求最终输出一个换行。
   不过,计算机程序是很难准确判断PE错误的,所以,很多PE错误都会被评判成WA。
   你的程序没有通过编译。你可以点击文字上的链接,查看详细的出错信息,对照此信息,可以找出出错原因。
一般来说,这种错误主要是由 Linux 环境下相关编译器与你使用的本地编译器之间的差异造成的
   我们正在运行你的程序进行测试,请稍候。
   我们更新了测试数据或者评判程序,并且正在进行重测,这个过程比较耗费资源,请稍候。
Time Limit Exceeded
   你的程序运行的时间超过了该题规定的最大时间,你的程序被Online Judge强行终止。
   注意:TE并不能说明你的程序的运行结果是对还是错,只能说明你的程序用了太多的时间。
Memory Limit Exceeded
   你的程序运行时使用的内存,超过了该题规定的最大限制,或者你的程序申请内存失败,你的程序将被Online
Judge强行终止。
   注意:ML并不能说明你的程序的运行结果是对还是错,只能说明你的程序用了或者申请了太多的内存。
Function Limit Exceeded
   你的程序运行时使用我们不允许使用的调用,将会得到此错误,诸如文件操作等相关函数。
   请特别注意:system("PAUSE"); 也会导致此错误。
Output Limit Exceeded
  你的程序输出了太多的东西。
   Online Judge规定提交的程序在运行的时候只能输出1024K字节的东西,如果你输出太多,将导致此错误。
  我们保证所有的题目的标准输出都小于1024K字节。
Runtime Error
System Error
   系统发生了错误。由于异常因素导致系统没有正常运作。我们尽力保证系统的稳定运行,但如您遇此情况,请联系管理员。
Online Judge 支持哪些编程语言?
到目前为止,本 Online Judge 已经支持 C、C++、PASCAL、JAVA 编程语言
如果题目包含多组测试数据,我应该在何时输出我的结果?
OnlineJudge中,你的程序的输入和输出是相互独立的,因此,每当处理完一组测试数据,就应当按题目要求进行相应的输出操作。而不必将所有结果储存起来一起输出。
GCC 中如何使用64位数?
定义64位数使用 long long 类型,输出格式串中使用 %lld
表示64位数。
关于本系统
本系统内核部分作者:孙威、王岩,WEB部分作者:王岩。独立自主开发,保留一切权利。
南开大学信息学院、南开大学ACM协会
Runtime Error 代号介绍
SIG (Signal,Linux系统信号)
(4)SIGILL 执行了非法指令. 通常是因为可执行文件本身出现错误,
或者试图执行数据段.堆栈溢出时也有可能产生这个信号.
(6)SIGABRT 程序自己发现错误并调用abort时产生.
(6)SIGIOT 在PDP-11上由iot指令产生, 在其它机器上和SIGABRT一样.
(7)SIGBUS 非法地址, 包括内存地址对齐(alignment)出错. eg: 访问一个四个字长的整数,
但其地址不是4的倍数.
(8)SIGFPE 在发生致命的算术运算错误时发出. 不仅包括浮点运算错误,
还包括溢出及除数为0等其它所有的算术的错误.
(11)SIGSEGV 试图访问未分配给自己的内存, 或试图往没有写权限的内存地址写数据.
   造成这种错误的原因有很多,主要原因有三条:
   一、数据下标越界,包括越上界和越下界。
   二、堆栈溢出,比如递归层数过多。
   三、不恰当的指针使用。
FPC (由Free Pascal
产生的错误代码):
由于OJ系统已经限制了程序的行为,所以以下部分代码并不会实际出现,此处列举仅仅为了文档相对完整。
1 Invalid function number 错误的功能代码
2 File not found 文件未找到
3 Path not found 目录未发现
4 Too many open files 打开太多的文件
5 File access denied 文件访问拒绝
6 Invalid file handle 错误的文件句柄
12 Invalid file access code 错误的文件访问代码
15 Invalid drive number 错误的驱动器数字
16 Cannot remove current directory 不能移动当前目录
17 Cannot rename across drives 不能跨越驱动器更改文件名
100 Disk read error 磁盘读错误
101 Disk write error 磁盘写错误
102 File not assigned 文件未曾建立关联
103 File not open 文件未打开
104 File not open for input 文件不能打开读数据
105 File not open for output 文件不能打开写数据
106Invalid numeric format 错误的数字格式
从标准输入(Text文件)中预期得到的数字格式不对.
150 Disk is write-protected
151 Bad drive request struct length
152 Drive not ready
154 CRC error in data
156 Disk seek error
157 Unknown media type
158 Sector Not Found
159 Printer out of paper
160 Device write fault
161 Device read fault
162 Hardware failure
200Division by zero
被除数为0.
201Range check error
如果你编译你的程序时设置了方位检查,原因有可能是:
数组访问超过了声明的范围.
试图给一个变量赋值超过其范围(例如枚举类型).
202Stack overflow error
栈增长超过了最大值 (in which case the size of local variables should be
reduced to avoid this error), or the stack has become corrupt.
只有当栈检查时才出现该错误.
203Heap overflow error
堆增长超过了上界. This is caused when trying to allocate memory exlicitly
with New, GetMem or ReallocMem, or when a class or object instance
is created and no memory is left. Please note that, by default,
Free Pascal provides a growing heap, i.e. the heap will try to
allocate more memory if needed. However, if the heap has reached
the maximum size allowed by the operating system or hardware, then
you will get this error.
204Invalid pointer operation
错误的指针操作
使用 Dispose or Freemem 时使用错误的指针 (特别的, Nil)
205Floating point overflow
浮点数上溢
你试图使用或产生一个太大实数.
206Floating point underflow
你试图使用或产生一个太小实数.
207Invalid floating point operation
错误的浮点数操作
可能是你开平方根或者对数时使用负数.
210Object not initialized
对象未初始化
When compiled with range checking on, a program will report this
error if you call a virtual method without having called istr
constructor.
211 Call to abstract method
212 Stream registration error
213 Collection index out of range
214 Collection overflow error
215Arithmetic overflow error 数字超出范围
例如超出长整形范围
216 General Protection fault
217 Unhandled exception occurred
219 Invalid typecast
227 Assertion failed error
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

我要回帖

更多关于 runtime error acm 的文章

 

随机推荐