# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1099656 | Math4Life2020 | Alternating Heights (CCO22_day1problem1) | C++17 | 581 ms | 14116 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;
using ll = long long; using pii = pair<ll,ll>;
const ll Nm = 3005;
ll N;
ll a[Nm];
ll ans[Nm];
bool qry(ll x, ll y) {
ll ncount = 0;
ll tfound[N];
ll fleft[N];
for (ll i=0;i<N;i++) {
tfound[i]=-1;
}
vector<ll> fadj[N];
vector<ll> radj[N];
for (ll i=x;i<y;i++) {
if ((i-x)%2) {
fadj[a[i]].push_back(a[i+1]);
radj[a[i+1]].push_back(a[i]);
} else {
fadj[a[i+1]].push_back(a[i]);
radj[a[i]].push_back(a[i+1]);
}
}
stack<pii> s;
for (ll i=0;i<N;i++) {
fleft[i]=fadj[i].size();
if (fadj[i].size()==0) {
# | 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... |