QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#133445 | #4935. Exchange Bottleneck | Delay_for_five_minutes# | WA | 1ms | 3704kb | C++20 | 301b | 2023-08-02 09:31:59 | 2023-08-02 09:32:00 |
Judging History
answer
#include<bits/stdc++.h>
int main() {
int n;
scanf("%d",&n);
int ans = 0;
int pre = 0;
for(int i=1;i<n;i++) {
int x;
scanf("%d",&x);
if (x == 0) pre ++;
else pre = 0;
ans = std::max(ans, pre + 1);
}
printf("%d\n",ans);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3700kb
input:
5 1 0 1 0
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
7 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3704kb
input:
2 0
output:
2
result:
wrong answer 1st lines differ - expected: '1', found: '2'