QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
详细
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'