QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#753039 | #4935. Exchange Bottleneck | MeatInTheMiddle# | WA | 0ms | 3668kb | C++17 | 972b | 2024-11-16 11:03:13 | 2024-11-16 11:03:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define fastio (ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL))
typedef long long ll;
typedef long double lld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
const int MAXSIZE = 2000000;
const long long INF = 1e18 + 5;
const double EPSILON = 1e-14;
const ll DIV = 2000003;
const long double pi = 3.14159265358979323846264338327950288419716939937510L;
int n;
int arr[101010];
int main()
{
fastio;
int ans = 1;
cin >> n;
int cur = 0;
for (int i = 1; i < n; i++)
{
int a;
cin >> arr[i];
if (n > 3 && a == 0)
ans = 2;
}
int mx = 0;
int con = 0;
for (int i = 1; i < n; i++)
{
if (arr[i] == 0)
{
con++;
}
else
con = 0;
}
if (con == n - 1)
con--;
ans = max(ans, con + 1);
cout << ans;
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3668kb
input:
5 1 0 1 0
output:
2
result:
ok single line: '2'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3592kb
input:
7 1 1 1 1 1 1
output:
2
result:
wrong answer 1st lines differ - expected: '1', found: '2'