0_0_38227902_7064.cpp:1:1: error: 'include' does not name a type
include <cstdio>
^
0_0_38227902_7064.cpp: In function 'int main()':
0_0_38227902_7064.cpp:18:38: error: 'scanf' was not declared in this scope
int main() { while(scanf("%d%d",&n,&m),n) { for (int i=1;i<=n;i++) cin>>a[i].u>>a[i].v>>a[i].w; for (int i=1;i<=m;i++) fa[i]=i; if(n<m-1) { printf("?\n"); continue; } sort(a+1,a+1+n,cmp); int sum=0; for(int i=1;i<=n;i++) { if(check(a[i].u,a[i].v)) { sum+=a[i].w; } } int cnt=0; for (int i=1;i<=m;i++) { if(fa[i]==i) cnt++; } if(cnt==1) printf("%d\n",sum); else printf("?\n"); } return 0; }
^
0_0_38227902_7064.cpp:18:68: error: 'cin' was not declared in this scope
int main() { while(scanf("%d%d",&n,&m),n) { for (int i=1;i<=n;i++) cin>>a[i].u>>a[i].v>>a[i].w; for (int i=1;i<=m;i++) fa[i]=i; if(n<m-1) { printf("?\n"); continue; } sort(a+1,a+1+n,cmp); int sum=0; for(int i=1;i<=n;i++) { if(check(a[i].u,a[i].v)) { sum+=a[i].w; } } int cnt=0; for (int i=1;i<=m;i++) { if(fa[i]==i) cnt++; } if(cnt==1) printf("%d\n",sum); else printf("?\n"); } return 0; }
^
0_0_38227902_7064.cpp:18:153: error: 'printf' was not declared in this scope
int main() { while(scanf("%d%d",&n,&m),n) { for (int i=1;i<=n;i++) cin>>a[i].u>>a[i].v>>a[i].w; for (int i=1;i<=m;i++) fa[i]=i; if(n<m-1) { printf("?\n"); continue; } sort(a+1,a+1+n,cmp); int sum=0; for(int i=1;i<=n;i++) { if(check(a[i].u,a[i].v)) { sum+=a[i].w; } } int cnt=0; for (int i=1;i<=m;i++) { if(fa[i]==i) cnt++; } if(cnt==1) printf("%d\n",sum); else printf("?\n"); } return 0; }
^
0_0_38227902_7064.cpp:18:186: error: 'sort' was not declared in this scope
int main() { while(scanf("%d%d",&n,&m),n) { for (int i=1;i<=n;i++) cin>>a[i].u>>a[i].v>>a[i].w; for (int i=1;i<=m;i++) fa[i]=i; if(n<m-1) { printf("?\n"); continue; } sort(a+1,a+1+n,cmp); int sum=0; for(int i=1;i<=n;i++) { if(check(a[i].u,a[i].v)) { sum+=a[i].w; } } int cnt=0; for (int i=1;i<=m;i++) { if(fa[i]==i) cnt++; } if(cnt==1) printf("%d\n",sum); else printf("?\n"); } return 0; }
^
0_0_38227902_7064.cpp:18:354: error: 'printf' was not declared in this scope
int main() { while(scanf("%d%d",&n,&m),n) { for (int i=1;i<=n;i++) cin>>a[i].u>>a[i].v>>a[i].w; for (int i=1;i<=m;i++) fa[i]=i; if(n<m-1) { printf("?\n"); continue; } sort(a+1,a+1+n,cmp); int sum=0; for(int i=1;i<=n;i++) { if(check(a[i].u,a[i].v)) { sum+=a[i].w; } } int cnt=0; for (int i=1;i<=m;i++) { if(fa[i]==i) cnt++; } if(cnt==1) printf("%d\n",sum); else printf("?\n"); } return 0; }
^
0_0_38227902_7064.cpp:18:374: error: 'printf' was not declared in this scope
int main() { while(scanf("%d%d",&n,&m),n) { for (int i=1;i<=n;i++) cin>>a[i].u>>a[i].v>>a[i].w; for (int i=1;i<=m;i++) fa[i]=i; if(n<m-1) { printf("?\n"); continue; } sort(a+1,a+1+n,cmp); int sum=0; for(int i=1;i<=n;i++) { if(check(a[i].u,a[i].v)) { sum+=a[i].w; } } int cnt=0; for (int i=1;i<=m;i++) { if(fa[i]==i) cnt++; } if(cnt==1) printf("%d\n",sum); else printf("?\n"); } return 0; }
^
|