# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1203 | gs12117 | 탐사 (KOI13_probe) | C++98 | 2 ms | 376 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>
int a[1010][3];
int edge[162][3];
int len[42];
int uft[42][2];
int en;
int n,m;
int f(int x){
if(uft[x][0]==x)return x;
f(uft[x][0]);
uft[x][1]+=uft[uft[x][0]][1];
uft[x][0]=uft[uft[x][0]][0];
return uft[x][0];
}
int main(){
int i,j,k,l,t;
scanf("%d%d",&m,&n);
for(i=0;i<=m;i++){
uft[i][0]=i;
}
for(i=0;i<n;i++){
scanf("%d%d%d",&a[i][0],&a[i][1],&a[i][2]);
a[i][0]--;
if(f(a[i][0])==f(a[i][1])){
if(uft[a[i][1]][1]!=uft[a[i][0]][1]+a[i][2]){
printf("NONE");
return 0;
}
}
else{
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... |