QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#588510 | #9375. Tourist | mwh | Compile Error | / | / | C++20 | 334b | 2024-09-25 12:31:37 | 2024-09-25 12:31:37 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
long long n,m,ans=1500;
cin>>n;
bool flag=false;
for(int i=0;i<n;i++){
int a;
cin>>a;
ans+=a;
if(ans>=4000)flag=true,m=i+1,break;
}
if(flag)cout<<m<<endl;
else cout<<"-1"<<endl;
return 0;
}
Details
answer.code: In function ‘int main()’: answer.code:13:46: error: expected primary-expression before ‘break’ 13 | if(ans>=4000)flag=true,m=i+1,break; | ^~~~~