QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#300404#4935. Exchange BottleneckLeeShoW#WA 0ms3548kbC++20664b2024-01-08 10:44:492024-01-08 10:44:49

Judging History

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

  • [2024-01-08 10:44:49]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3548kb
  • [2024-01-08 10:44:49]
  • 提交

answer

#include<iostream>
#include<algorithm>
#include<random>
#include<chrono>
#define pii pair<int,int>
using namespace std;
int main(){
    int n;
    cin>>n;
    int all[n];
    int pre=0;
    int cnt=1;
    int ans=1;
    for(int i=0;i<n-1;i++){
        cin>>all[i];
        if(i==0){
            if(all[i]==0){
                cnt++;       
            }else{
                cnt=1;
            }
        }else {
            if(all[i]==0){
                cnt++;       
            }else{
                cnt=1;
            }
        }
        pre=all[i];
        ans=max(ans,cnt);
    }
    cout<<ans<<endl;
    

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1 0 1 0

output:

2

result:

ok single line: '2'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

7
1 1 1 1 1 1

output:

1

result:

ok single line: '1'

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3372kb

input:

2
0

output:

2

result:

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