# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
773900 | vjudge1 | Paint (COI20_paint) | C++17 | 23 ms | 2324 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 lalala ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"
//#define int long long int
#define N 200005
int limit[N][2],renk[N];
int father[N];
int dsu(int x){
if(father[x]==x)return x;
return father[x]=dsu(father[x]);
}
void kardes(int x,int y){
x=dsu(x),y=dsu(y);
if(x==y)return;
father[y]=x;
limit[x][0]=min(limit[x][0],limit[y][0]);
limit[x][1]=max(limit[x][1],limit[y][1]);
}
int geldik[N];
int main(){
lalala;
int n,m;
cin>>n>>m;
for(int i=0;i<n;i++){
for(int j=1;j<=m;j++){
cin>>renk[j];
limit[j][0]=limit[j][1]=j;
father[j]=j;
# | 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... |