# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
667539 | berr | Fancy Fence (CEOI20_fancyfence) | C++17 | 278 ms | 7508 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;
#define int long long
const int N=1e5+37;
int p[N], vis[N], length[N];
int sum, ans=0, mod=1e9+7;
int s(int x, int y){
return ((x+y)%mod+mod)%mod;
}
int mul(int x, int y){
return (x*y)%mod;
}
int poww(int x, int y){
if(y==0) return 1;
int tmp=poww(x, y/2);
if(y&1) return mul(tmp, mul(tmp, x));
return mul(tmp, tmp);
}
int val(int x){
return mul(mul(x, (x+1)), poww(2, mod-2));
}
int find(int x){
return (p[x]!=x)?p[x]=find(p[x]):x;
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |