QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#511074#8777. Passport StampsNoobie_99#WA 3ms4020kbC++20617b2024-08-09 15:53:112024-08-09 15:53:11

Judging History

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

  • [2024-08-09 15:53:11]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:4020kb
  • [2024-08-09 15:53:11]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define tsolve int t; cin >> t; while(t--) solve
#define debug(x) cerr << __LINE__ << ": "#x" = " << (x) << endl
#define all(x) ::begin(x), ::end(x)
#define sz(x) (int)::size(x)
using ll = long long;
using ld = long double;

void solve() {
	ll n, p;
	cin >> n >> p;

	vector<ll> a(n);
	for (ll& e : a) cin >> e;

	int ans = n;
	ll sm = 0;
	for (ll i=0; i<n; i++) {
		ll x = (i+1) * (a[i]-1) + sm;
		if (x >= p) {
			ans = i;
			break;
		}
		sm += a[i];
	}

	cout << ans << '\n';
}

int main() {
	cin.tie(0)->sync_with_stdio(false);
	cout << setprecision(16);
	solve();
}

詳細信息

Test #1:

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

input:

5 15
1
2
3
4
5

output:

3

result:

ok single line: '3'

Test #2:

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

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: 4020kb

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'