QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#315050 | #4935. Exchange Bottleneck | yuyutw# | WA | 8ms | 4008kb | C++14 | 522b | 2024-01-26 20:48:32 | 2024-01-26 20:48:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define io ios::sync_with_stdio(0), cin.tie(0);
#define endl '\n'
#define MXN (ll)1e6+5
int main(){
int n;
cin >> n;
int arr[n-1];
int nw = 0, mx = 0;
for(int i=0;i<n-1;i++) {
cin >> arr[i];
if(arr[i] == 0) {
nw++;
} else {
nw = 0;
}
mx = max(nw, mx);
}
if(mx == n-1){
cout << mx << endl;
} else
cout << mx+1 << endl;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3532kb
input:
5 1 0 1 0
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3728kb
input:
7 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
2 0
output:
1
result:
ok single line: '1'
Test #4:
score: -100
Wrong Answer
time: 8ms
memory: 4008kb
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'