|
|
back to boardDifferent results for G++ 4.7.2 and VC++ 2010. Posted by Semm 7 Apr 2014 22:22 My code #include <stdio.h> int main() { long long n, s; int m; scanf("%lld%d",&n,&m); n*=(long long)3; s=0; for(int i=0; i<m; i++) { int t; scanf("%d",&t); s+=t; if(s>n) { printf("Free after %d times.",i+1); return 0; } } printf("Team.GOV!"); return 0; } Works fine on my machine under Linux (g++ 4.8.2). On the OnlineJudge I get WA1 on g++ and AC on VC++ 2010. I think something is wrong. Re: Different results for G++ 4.7.2 and VC++ 2010. %lld doesn't work for MinGW GCC. Use %I64d Re: Different results for G++ 4.7.2 and VC++ 2010. Posted by Semm 10 Apr 2014 18:50 Danke! |
|
|