QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#428050#8777. Passport Stampsucup-team3548#WA 0ms3524kbC++17429b2024-06-01 17:10:532024-06-01 17:10:54

Judging History

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

  • [2024-06-01 17:10:54]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3524kb
  • [2024-06-01 17:10:53]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll = __int128_t;
int main() {
    int n, p;
    cin >> n >> p;
    ll pre = 0;
    int ans = 0;

    for (int i = 1; i <= n; ++i) {
        long long _c; cin >> _c;
        ll c = _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: 3508kb

input:

5 15
1
2
3
4
5

output:

3

result:

ok single line: '3'

Test #2:

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

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'