QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#587024 | #9375. Tourist | gcc | WA | 0ms | 3704kb | C++20 | 411b | 2024-09-24 17:10:15 | 2024-09-24 17:10:16 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
int n;
cin >> n;
vector<int>a(n + 1);
int ben = 0;
for(int i = 1; i <= n; i++){
cin >> a[i];
}
for(int i = 1; i <= n; i++){
ben += a[i];
if(ben >= 4000){
cout << i << endl;
return;
}
}
cout << -1 << endl;
}
int main(){
int _;
cin >> _;
while(_--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3704kb
input:
5 1000 1000 1000 -5000 1000
output:
-1 -1 -1 -1 -1
result:
wrong answer 1st lines differ - expected: '3', found: '-1'