# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
345402 | casperwang | Tropical Garden (IOI11_garden) | C++14 | 3077 ms | 45076 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>
#include "garden.h"
#include "gardenlib.h"
#define pb emplace_back
using namespace std;
#define debug(args...) kout("[ " + string(#args) + " ]", args)
void kout() { cerr << endl; }
template <class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ',kout(b...); }
template <class T> void pary(T L, T R) { while (L != R) cerr << *L << " \n"[++L==R]; }
const int MAXN = 150000;
const int MAXQ = 2000;
void count_routes(int N, int M, int P, int R[][2], int Q, int G[]) {
vector <vector<int>> tmp(N), path(2*N), repath(2*N);
for (int i = 0; i < M; i++) {
tmp[R[i][0]].pb(R[i][1]);
tmp[R[i][1]].pb(R[i][0]);
}
for (int i = 0; i < N; i++) {
int t = tmp[i][0];
t = (tmp[t][0] == i ? t+N : t);
path[i].pb(t);
repath[t].pb(i);
if (tmp[i].size() > 1) {
t = tmp[i][1];
t = (tmp[t][0] == i ? t+N : t);
path[i+N].pb(t);
repath[t].pb(i+N);
} else {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |