QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#428033#8777. Passport Stampsucup-team3548#WA 0ms3708kbC++17393b2024-06-01 17:04:322024-06-01 17:04:32

Judging History

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

  • [2024-06-01 17:04:32]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3708kb
  • [2024-06-01 17:04:32]
  • 提交

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) >= 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: 3636kb

input:

5 15
1
2
3
4
5

output:

3

result:

ok single line: '3'

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3708kb

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'