# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
705020 | MtSaka | Financial Report (JOI21_financial) | C++17 | 639 ms | 77320 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 rep(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rrep(i,a,b) for(ll i=(ll)b-1;i>=(ll)a;i--)
#define all(x) begin(x),end(x)
using ll=long long;
using namespace std;
using ull=unsigned long long;
template<typename T,typename U>
inline bool chmax(T&a,const U&b){return (a<b)?a=b,true:false;}
template<typename T,typename U>
inline bool chmin(T&a,const U&b){return (a>b)?a=b,true:false;}
struct dsu{
private:
vector<int>p;
vector<int>mx;
public:
dsu(int n):p(n,-1),mx(n,0){iota(all(mx),0);}
int root(int a){return p[a]<0?a:p[a]=root(p[a]);}
int same(int a,int b){return root(a)==root(b);}
int get(int a){return mx[root(a)];}
void merge(int a,int b){
a=root(a),b=root(b);
if(a==b)return;
if(p[a]>p[b])swap(a,b);
p[a]+=p[b];
p[b]=a;
chmax(mx[a],mx[b]);
}
};
struct segtree{
# | 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... |