Submission #1203

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
12032013-06-29 15:56:28gs12117탐사 (KOI13_probe)C++98
19 / 19
2 ms376 KiB
#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{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

probe.cpp: In function 'int main()':
probe.cpp:16:13: warning: unused variable 'k' [-Wunused-variable]
     int i,j,k,l,t;
             ^
probe.cpp:16:15: warning: unused variable 'l' [-Wunused-variable]
     int i,j,k,l,t;
               ^
probe.cpp:17:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&m,&n);
     ~~~~~^~~~~~~~~~~~~~
probe.cpp:22:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d",&a[i][0],&a[i][1],&a[i][2]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...