QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#581329 | #9375. Tourist | nuo | WA | 0ms | 3948kb | C++20 | 501b | 2024-09-22 12:04:22 | 2024-09-22 12:04:22 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n, c, tot = 1500, ans = -1;
inline int read() {
int x = 0, f = 1; char c = getchar();
while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); }
while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
return x * f;
}
signed main() {
n = read();
for (int i = 1; i <= n; i++) {
c = read(), tot += c;
if (ans != -1 && tot >= 4000) ans = i;
}
printf("%d\n", ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3948kb
input:
5 1000 1000 1000 -5000 1000
output:
-1
result:
wrong answer 1st lines differ - expected: '3', found: '-1'