# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
113624 | aminra | Port Facility (JOI17_port_facility) | C++14 | 6012 ms | 63708 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;
typedef long long ll;
typedef long double ld;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)2e6 + 3;
const int infint = (int)2e9;
const ll inf = (ll)2e18;
int cyc = 0;
int a[MAXN], b[MAXN], n, c[MAXN];
vector<int> G[MAXN];
void dfs(int u, int color)
{
c[u] = color;
for (auto v : G[u])
if(!c[v])
dfs(v, 3 - color);
else
if(c[v] == c[u])
cyc = 1;
}
int pwr(int a, int b)
{
if(b == 0)
return 1;
int c = pwr(a, b >> 1);
c = 1LL * c * c % MOD;
if(b & 1)
c = 1LL * c * a % MOD;
return c;
# | 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... |