QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#526305#8777. Passport StampsOneWan#WA 3ms3880kbC++23598b2024-08-21 13:11:352024-08-21 13:11:36

Judging History

This is the latest submission verdict.

  • [2024-08-21 13:11:36]
  • Judged
  • Verdict: WA
  • Time: 3ms
  • Memory: 3880kb
  • [2024-08-21 13:11:35]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    i64 p;
    cin >> n >> p;
    vector<i64> a(n);
    for (int i = 0 ; i < n ; i++) {
        cin >> a[i];
    }
    i64 sum = 0;
    for (int i = 0 ; i < n ; i++) {
        i64 res = sum + (a[i] - 1) * i;
        res += a[i];
        // cout << res << "\n";
        if (res > p) {
            cout << i << "\n";
            return 0;
        }
        sum += a[i];
    }
    cout << n << "\n";
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3612kb

input:

5 15
1
2
3
4
5

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 3ms
memory: 3808kb

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:

84437

result:

ok single line: '84437'

Test #3:

score: 0
Accepted
time: 3ms
memory: 3880kb

input:

100000 890934113082207108
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

53636

result:

ok single line: '53636'

Test #4:

score: -100
Wrong Answer
time: 3ms
memory: 3808kb

input:

100000 132839930703581978
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

59361

result:

wrong answer 1st lines differ - expected: '59360', found: '59361'