QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#828271#8777. Passport StampssuoWA 1ms3868kbC++20421b2024-12-23 15:21:162024-12-23 15:21:17

Judging History

This is the latest submission verdict.

  • [2024-12-23 15:21:17]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3868kb
  • [2024-12-23 15:21:16]
  • Submitted

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;
}

详细

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'