QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#225253 | #4935. Exchange Bottleneck | Rabeya# | WA | 4ms | 4312kb | C++17 | 1.1kb | 2023-10-24 12:19:32 | 2023-10-24 12:19:32 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef unordered_map<int,int> umap;
typedef long double ld;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define popcount __builtin_popcount
#define case cout<<"Case "<<__testcase-testcase<<": ";
#define endl '\n'
#define inf 1e9
ll a[100500];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int testcase=1;
//cin>>testcase;
int __testcase=testcase;
while(testcase--){
int n;
cin>>n;
int mx=1,cnt=1;
for(int i=0;i<n-1;i++){
cin>>a[i];
if(i==0)a[i]=1;
if(a[i]==0)
{
mx=max(mx,2);
cnt++;
}
else
{
mx=max(mx,cnt);
cnt=1;
}
}
mx=max(mx,cnt);
cout<<mx<<endl;
}
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3568kb
input:
5 1 0 1 0
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3396kb
input:
7 1 1 1 1 1 1
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3428kb
input:
2 0
output:
1
result:
ok single line: '1'
Test #4:
score: -100
Wrong Answer
time: 4ms
memory: 4312kb
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'