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 1688. Team.GOV!

Different 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.
Posted by Vladimir Yakovlev (USU) 9 Apr 2014 12:05
%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!