QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#427136#8777. Passport Stampsucup-team3282#WA 1ms5700kbC++20568b2024-06-01 10:17:302024-06-01 10:17:30

Judging History

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

  • [2024-06-01 10:17:30]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5700kb
  • [2024-06-01 10:17:30]
  • 提交

answer

#include<iostream>
#include<cstring>
#include<cmath>
using namespace std;
int r[1000050];
int sum[1000050];
int main(){
    int n,q;cin>>n>>q;
    for(int i=1;i<=n;i++)cin>>r[i];
    for(int i=1;i<=n;i++){
        sum[i]=r[i]+sum[i-1];
    }  
    
    int ans=0;
    if(q<r[1]){
        cout<<0<<endl;
        return 0;
    }
    for(int i=1;i<n;i++){
        // cout<<(q-sum[i])/(i+1)<<"<"<<mn[i+1]<<endl;
        if((q-sum[i])/(i+1)+((q-sum[i])%(i+1)>=1?1:0)<r[i+1]){
            cout<<i<<endl;return 0;
        }
    }
    cout<<n<<endl;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5 15
1
2
3
4
5

output:

3

result:

ok single line: '3'

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3860kb

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:

100000

result:

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