# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
18994 | kriii | 트리 (kriii4_X) | C++14 | 526 ms | 25636 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 <stdio.h>
#include <map>
#include <set>
using namespace std;
const long long mod = 1000000007;
long long fpow(long long a, long long p)
{
long long r = 1;
while (p){
if (p & 1) r = r * a % mod;
a = a * a % mod;
p /= 2;
}
return r;
}
map<int, int> par,sz;
int find(int x)
{
bool good = par.count(x);
int &p = par[x];
if (!good){
p = x;
sz[x] = 1;
}
else{
if (x != p) p = find(p);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |