QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#164162#4935. Exchange Bottleneckchengcheng567WA 4ms3656kbC++14256b2023-09-04 20:26:422023-09-04 20:26:42

Judging History

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

  • [2023-09-04 20:26:42]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:3656kb
  • [2023-09-04 20:26:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,ans=1,op=-1;
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: 1ms
memory: 3620kb

input:

5
1 0 1 0

output:

2

result:

ok single line: '2'

Test #2:

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

input:

7
1 1 1 1 1 1

output:

1

result:

ok single line: '1'

Test #3:

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

input:

2
0

output:

1

result:

ok single line: '1'

Test #4:

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

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'