QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#428044 | #8777. Passport Stamps | ucup-team3548# | WA | 0ms | 3684kb | C++17 | 399b | 2024-06-01 17:08:18 | 2024-06-01 17:08:19 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int n, p;
cin >> n >> p;
ll pre = 0;
int ans = 0;
for (int i = 1; i <= n; ++i) {
ll c; cin >> c;
if (p - (pre + (c - 1) * (i - 1)) >= c) {
ans = i;
} else {
break;
}
pre += c;
}
cout << ans;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3548kb
input:
5 15 1 2 3 4 5
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3684kb
input:
100000 559309580160692839 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
0
result:
wrong answer 1st lines differ - expected: '84437', found: '0'