QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#133445#4935. Exchange BottleneckDelay_for_five_minutes#WA 1ms3704kbC++20301b2023-08-02 09:31:592023-08-02 09:32:00

Judging History

This is the latest submission verdict.

  • [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:32:00]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3704kb
  • [2023-08-02 09:31:59]
  • Submitted

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'