QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#427124#8777. Passport Stampsucup-team3099#RE 1ms3596kbC++23545b2024-06-01 10:12:352024-06-01 10:12:37

Judging History

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

  • [2024-06-01 10:12:37]
  • 评测
  • 测评结果:RE
  • 用时:1ms
  • 内存:3596kb
  • [2024-06-01 10:12:35]
  • 提交

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
...

output:


result: