# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
960029 | Huseyn123 | Fancy Fence (CEOI20_fancyfence) | C++17 | 87 ms | 9220 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 MAX 100001
#define MOD 1000000007
using namespace std;
typedef long long ll;
ll n,x,y,z,w[MAX],h[MAX],a[MAX];
struct DSU{
vector<int> e;
DSU(int N){e.resize(N+1,-1);}
int get(int x){return (e[x]<0) ? x : e[x]=get(e[x]);}
int size(int x){return w[get(x)];}
bool unite(int x,int y){
x=get(x);
y=get(y);
if(x==y) return false;
if(e[x]>e[y]) swap(x,y);
e[x]+=e[y]; w[x]+=w[y]; w[x]%=MOD; e[y]=x;
return true;
}
};
ll powmod(ll x,ll y,ll mod){
if(y==0){
return 1;
}
ll res=1;
x%=mod;
while(y>0){
if(y%2){
res*=x;
res%=mod;
# | 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... |