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!

WA_1_(%lld)
Posted by Gubarev Valentin (Pskov) 9 Mar 2009 16:51
//AC
#include<iostream>
using namespace std;

long long n;//Плата за выход
long long m;//Кол-во походов
long long sum;//Сколько заплачено в ресторане
long long x;

int main(){
    cin>>n>>m;//scanf("%lld%lld",&n,&m);
    n*=3;
    int i=0;
    while(i<m){
        ++i;
        cin>>x;//scanf("%lld",&x);
        sum+=x;
        if(sum>n)break;
    }
    if(sum>n)
        printf("Free after %d times.",i);
    else
        printf("Team.GOV!");
    return 0;
}

if sin -> scanf then WA.  Way?
Re: WA_1_(%lld)
Posted by TIA (Lyceum #165) 12 Mar 2009 16:32
I have exactly the same problem but i've written my code on pascal. Maybe there are some wrong end-of-line's in the test data. On my home computer everything works right and i'm sure that my solution is right.

My solution had a silly bug: i wrote "Free after x times" without period (".")

Edited by author 12.03.2009 16:46