# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1079760 | quangminh412 | JOI 문장 (JOI14_ho_t1) | C++14 | 1 ms | 344 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
/*
John Watson
https://codeforces.com/profile/quangminh98
Mua Code nhu mua Florentino !!
*/
#define faster() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
const int maxn = 1e5 + 9;
int arr[maxn];
int n;
int solve(int u, int v)
{
int l = u, r = v;
int ans = v - u + 1;
u--, v++;
while (0 < u && arr[u] != (u + 1 == l ? arr[u + 1] ^ 1 : arr[u + 1])) u--, ans++;
while (v <= n && arr[v] != (v - 1 == r ? arr[v - 1] ^ 1 : arr[v - 1])) v++, ans++;
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |