QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#312863 | #4935. Exchange Bottleneck | AnthonyQwO# | WA | 1ms | 3748kb | C++23 | 484b | 2024-01-24 14:21:31 | 2024-01-24 14:21:32 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, ret = 1, cur = 0;
cin >> n;
vector<int> arr(n);
for( int i=1 ; i < n ; i++ ) cin >> arr[i];
for( int i=1 ; i < n ; i++ ) {
if( arr[i] == 1 ) {
if( cur ) ret = max(ret, (int)2);
cur = 0;
}
else cur++;
}
cout << max(cur+1, ret) << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3512kb
input:
5 1 0 1 0
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
7 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3748kb
input:
2 0
output:
2
result:
wrong answer 1st lines differ - expected: '1', found: '2'