QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#586665 | #9375. Tourist | YuLan# | WA | 0ms | 3700kb | C++14 | 377b | 2024-09-24 14:54:50 | 2024-09-24 14:54:51 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
int a[N];
int main()
{
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
int n;
cin>>n;
int now = 1500,x;
for(int i=1;i<=n;i++)
{
cin>>a[i];
}
a[0] = 0;
for(int i=0;i<=n;i++)
{
now = now + a[i];
if(now>=4000)
{
cout<<i<<endl;
break;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3700kb
input:
5 1000 1000 1000 -5000 1000
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3632kb
input:
5 20 -100 10 -150 5
output:
result:
wrong answer 1st lines differ - expected: '-1', found: ''