QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#427124 | #8777. Passport Stamps | ucup-team3099# | RE | 1ms | 3596kb | C++23 | 545b | 2024-06-01 10:12:35 | 2024-06-01 10:12:37 |
Judging History
answer
// #pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
// #include <x86intrin.h>
using namespace std;
#if __cplusplus >= 202002L
using namespace numbers;
#endif
int main(){
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(ios::badbit | ios::failbit);
int n, np;
cin >> n >> np;
long long sum = 0;
for(auto i = 0; i < n; ++ i){
long long x;
cin >> x;
if(__int128_t(x - 1) * (i + 1) + sum > np){
cout << i << "\n";
return 0;
}
sum += x;
}
cout << n << "\n";
return 0;
}
/*
*/
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3596kb
input:
5 15 1 2 3 4 5
output:
3
result:
ok single line: '3'
Test #2:
score: -100
Runtime Error
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 ...