QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#133452#4935. Exchange BottleneckDelay_for_five_minutes#WA 2ms3880kbC++20302b2023-08-02 09:35:092023-08-02 09:35:13

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-02 09:35:13]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3880kb
  • [2023-08-02 09:35:09]
  • 提交

answer

#include<bits/stdc++.h>
int main() {
    int n;
    scanf("%d",&n);
    int ans = 0;
    int pre = -1;
    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: 0ms
memory: 3616kb

input:

5
1 0 1 0

output:

2

result:

ok single line: '2'

Test #2:

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

input:

7
1 1 1 1 1 1

output:

1

result:

ok single line: '1'

Test #3:

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

input:

2
0

output:

1

result:

ok single line: '1'

Test #4:

score: -100
Wrong Answer
time: 2ms
memory: 3664kb

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'