|
|
вернуться в форумWA_1_(%lld) //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) 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 |
|
|