QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#554376#8777. Passport StampsappearWA 10ms4420kbC++14399b2024-09-09 10:50:002024-09-09 10:50:01

Judging History

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

  • [2024-09-09 10:50:01]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:4420kb
  • [2024-09-09 10:50:00]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

const int N = 1e5 + 5;

int n;
long long p, a[N];

int main(){
  cin >> n >> p;
  for(int i = 1; i <= n; i++) cin >> a[i];
  long long sum = 0;
  for(int i = 1; i <= n; i++){
    if((p / a[i] - i + 1) * a[i] <= sum){
      cout << i - 1;
      return 0;
    }
    sum = min(p + 1, sum + a[i] - 1);
  }
  cout << n;
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5 15
1
2
3
4
5

output:

3

result:

ok single line: '3'

Test #2:

score: 0
Accepted
time: 9ms
memory: 4404kb

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: -100
Wrong Answer
time: 10ms
memory: 4420kb

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:

100000

result:

wrong answer 1st lines differ - expected: '53636', found: '100000'