QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#828271 | #8777. Passport Stamps | suo | WA | 1ms | 3868kb | C++20 | 421b | 2024-12-23 15:21:16 | 2024-12-23 15:21:17 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, p;
cin >> n >> p;
int c[n];
for (int i = 0; i < n; i++) {
cin >> c[i];
}
int sum = 0;
for (int i = 0; i < n; i++) {
int ci = c[i];
if (p <= (ci - 1) * (i + 1) + sum) {
cout << i << endl;
return 0;
}
sum += ci;
}
cout << n << endl;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
5 15 1 2 3 4 5
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3868kb
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:
100000
result:
wrong answer 1st lines differ - expected: '84437', found: '100000'