QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#580818 | #9375. Tourist | tzw | WA | 0ms | 3644kb | C++14 | 267b | 2024-09-22 00:05:32 | 2024-09-22 00:05:36 |
Judging History
answer
#include<iostream>
#define int long long
using namespace std;
signed main(){
int n;
cin>>n;
int sum=0;
int ans=-1;
for(int i=1;i<=n;i++){
int tmp;
cin>>tmp;
sum+=tmp;
if(sum>=4000){
ans=i;
break;
}
}
cout<<ans;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3644kb
input:
5 1000 1000 1000 -5000 1000
output:
-1
result:
wrong answer 1st lines differ - expected: '3', found: '-1'