QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#587244 | #9375. Tourist | 2023_ljd | WA | 0ms | 3552kb | C++23 | 364b | 2024-09-24 18:44:01 | 2024-09-24 18:44:01 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std ;
void solve() {
int n , val=1500 , ans=0 ; cin >> n ;
for(int i=1 ; i<=n ; i++) {
int x ; cin >> x ;
val += x ;
if(!ans && val >= 4000 ) ans = i ;
}
cout << ans << endl ;
}
int main() {
int t =1 ; //cin >> t ;
while(t--) solve() ;
return 0 ;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3540kb
input:
5 1000 1000 1000 -5000 1000
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3552kb
input:
5 20 -100 10 -150 5
output:
0
result:
wrong answer 1st lines differ - expected: '-1', found: '0'