QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#600524 | #9375. Tourist | JinYan_Yu | WA | 27ms | 4360kb | C++14 | 262b | 2024-09-29 17:08:06 | 2024-09-29 17:08:07 |
Judging History
answer
#include<iostream>
using namespace std;
const int N=1e5+10;
long long a[N];
int main()
{
int n;
cin>>n;
int f=-1;
a[0]=1500;
for(int i=1;i<=n;i++)
{
int x;
cin>>x;
a[i]=a[i-1]+x;
if(a[i]>4000) f=i;
}
cout<<f<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3456kb
input:
5 1000 1000 1000 -5000 1000
output:
3
result:
ok single line: '3'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
5 20 -100 10 -150 5
output:
-1
result:
ok single line: '-1'
Test #3:
score: -100
Wrong Answer
time: 27ms
memory: 4360kb
input:
100000 -622469318 539497462 -644931120 58116512 -531587090 908494982 839175844 702577848 -359659596 -940595076 -625597008 475756588 -944333680 -836413428 15282479 465161640 368734488 -915470952 168906352 507919069 -120921946 69204544 -142419900 -256757690 -773656014 194185932 398352052 550384408 -45...
output:
100000
result:
wrong answer 1st lines differ - expected: '7', found: '100000'