QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#164159 | #4935. Exchange Bottleneck | chengcheng567 | WA | 2ms | 3692kb | C++14 | 255b | 2023-09-04 20:26:07 | 2023-09-04 20:26:08 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n,ans=1,op=0;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);cin>>n;n--;
while(n--){
int x;cin>>x;
if(x==1){
op=0;
}else op++;
ans=max(ans,op+1);
}cout<<ans<<"\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3580kb
input:
5 1 0 1 0
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3692kb
input:
7 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #3:
score: -100
Wrong Answer
time: 2ms
memory: 3636kb
input:
2 0
output:
2
result:
wrong answer 1st lines differ - expected: '1', found: '2'