QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#591260 | #9375. Tourist | lamkappa | WA | 0ms | 3684kb | C++20 | 559b | 2024-09-26 15:00:20 | 2024-09-26 15:00:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T = 1;
// cin >> T;
while(T--){
int n; cin >> n;
long long sc = 1500;
for(int i=0, x; i<n; i++) {
cin >> x;
if(x > 0) {
sc += x;
if(sc >= 4000){
cout << i+1 << '\n';
goto end;
}
}
}
cout << "-1\n";
end:;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3560kb
input:
5 1000 1000 1000 -5000 1000
output:
3
result:
ok single line: '3'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
5 20 -100 10 -150 5
output:
-1
result:
ok single line: '-1'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3684kb
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:
2
result:
wrong answer 1st lines differ - expected: '7', found: '2'