# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
315280 | casperwang | Cat (info1cup19_cat) | C++14 | 546 ms | 20200 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>
#define int long long
#define pb push_back
#define pii pair<int,int>
#define ff first
#define ss second
using namespace std;
const int MAXN = 3000000;
int t, n;
int a[MAXN+1];
int c[MAXN+1];
int p[MAXN+1];
bool need[MAXN+1];
int tmp[MAXN+1];
int cnt;
vector <pii> ans;
void swp(int x, int y) {
swap(a[n-x+1], a[n-y+1]);
swap(p[a[n-x+1]], p[a[n-y+1]]);
swap(a[x], a[y]);
swap(p[a[x]], p[a[y]]);
}
void solve(int N) {
for (int i = 1; i <= N; i++) {
if (need[i]) {
int t = p[i];
while (!need[t] && t != i) t = p[t];
# | 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... |