QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#225252#4935. Exchange BottleneckRabeya#WA 3ms4376kbC++171.0kb2023-10-24 12:09:532023-10-24 12:09:54

Judging History

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

  • [2023-10-24 12:09:54]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:4376kb
  • [2023-10-24 12:09:53]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef unordered_map<int,int> umap;
typedef long double ld;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define popcount __builtin_popcount
#define case cout<<"Case "<<__testcase-testcase<<": ";
#define endl '\n'
#define inf 1e9

ll a[100500];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int testcase=1;
    //cin>>testcase;
    int __testcase=testcase;
    while(testcase--){
        int n;
        cin>>n;
        int mx=1,cnt=1;
        for(int i=0;i<n-1;i++){
            cin>>a[i];
            if(i==0)a[i]=1;
            if(a[i]==0)
            {
                mx=max(mx,2);
                cnt++;
            }
            else
            {
                mx=max(mx,cnt);
                cnt=1;
            }
        }
        cout<<mx<<endl;

    }
}





Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5
1 0 1 0

output:

2

result:

ok single line: '2'

Test #2:

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

input:

7
1 1 1 1 1 1

output:

1

result:

ok single line: '1'

Test #3:

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

input:

2
0

output:

1

result:

ok single line: '1'

Test #4:

score: -100
Wrong Answer
time: 3ms
memory: 4376kb

input:

90580
1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 ...

output:

5

result:

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