QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#828271#8777. Passport StampssuoWA 1ms3868kbC++20421b2024-12-23 15:21:162024-12-23 15:21:17

Judging History

你现在查看的是最新测评结果

  • [2024-12-23 15:21:17]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3868kb
  • [2024-12-23 15:21:16]
  • 提交

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'