QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#164159#4935. Exchange Bottleneckchengcheng567WA 2ms3692kbC++14255b2023-09-04 20:26:072023-09-04 20:26:08

Judging History

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

  • [2023-09-04 20:26:08]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3692kb
  • [2023-09-04 20:26:07]
  • 提交

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'