# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
666177 | ParsaS | Homework (CEOI22_homework) | C++17 | 352 ms | 167600 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.
// In the name of God
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
const int N = 1e6 + 5;
string s;
bool f[N];
map<ll, int> M;
inline ll F(int l, int r) {
return l + 1LL * r * N;
}
pair<int, int> SOLVE(int L, int R) {
pair<int, int> ans;
//cout << L << ' ' << R << ' ' << v << endl;
if (L >= R)
return mp(1, 1);
int v = M[F(L, R)];
if (L == R - 1) {
return f[v] ? mp(2, 2) : mp(1, 1);
}
int mid = v;
pair<int, int> lt = SOLVE(L, mid - 1);
pair<int, int> rt = SOLVE(mid, R);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |