QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#526334#8777. Passport Stampshnust_xiaoqi#WA 4ms4360kbC++20545b2024-08-21 13:51:392024-08-21 13:51:40

Judging History

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

  • [2024-08-21 13:51:40]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:4360kb
  • [2024-08-21 13:51:39]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define endl "\n"

using namespace std;

const int N = 2e5;

typedef long long LL;
typedef pair<int, int> PII;

LL d[N];

void solve() {
	LL n,m;
	cin>>n>>m;
	for(LL i=1;i<=n;++i){
		cin>>d[i];
	}
	LL ans=1;
	for(LL i=1;i<=n;++i){
		LL data=(m%ans!=0)+m/ans;
		if(data>=d[i]){
			m-=d[i];
			++ans;
		}
	}
	cout<<ans-1<<endl;
}

signed main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0);
	
	int t = 1;
	// cin >> t;
	while(t--) {
		solve();
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5 15
1
2
3
4
5

output:

3

result:

ok single line: '3'

Test #2:

score: -100
Wrong Answer
time: 4ms
memory: 4360kb

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:

99999

result:

wrong answer 1st lines differ - expected: '84437', found: '99999'