ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1587. Flying Pig

assert function
Posted by Madhav 13 Jun 2008 04:49
assert function doesn't work here.
for the program i used assert.it failed there was no response
#include<iostream>
#include<cassert>
using namespace std;
int main(){
assert(0==1);
return 0;
}
the above program must result in a statement program aborted.But instead the program gives WA
Re: assert function
Posted by Vladimir Yakovlev (USU) 13 Jun 2008 13:59
assert() function outputs a message and ends the program with nonzero return code. Of course, the Judge interprets such behaviour as wrong answer.
Re: assert function
Posted by Denis Koshman 20 Jul 2008 19:05
It is not "of course" becase other online judges (and real ACM contest servers) treat non-zero return as runtime error.

I usually abort with
#define FAIL *(int*)0 = 0
causes CRASH runtime error