QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#225253#4935. Exchange BottleneckRabeya#WA 4ms4312kbC++171.1kb2023-10-24 12:19:322023-10-24 12:19:32

Judging History

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

  • [2023-10-24 12:19:32]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:4312kb
  • [2023-10-24 12:19:32]
  • 提交

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;
            }
        }
        mx=max(mx,cnt);
        cout<<mx<<endl;

    }
}





详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3568kb

input:

5
1 0 1 0

output:

2

result:

ok single line: '2'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3396kb

input:

7
1 1 1 1 1 1

output:

1

result:

ok single line: '1'

Test #3:

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

input:

2
0

output:

1

result:

ok single line: '1'

Test #4:

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

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'