F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_33274304_7225.c:1:631: fatal error: bits/stdc++.h: No such file or directory
 /* HDU3140 Money Matters */ #include <bits/stdc++.h> using namespace std; const int N = 10000; int f[N], w[N]; void UFInit(int n) { for(int i = 0; i < n; i++) f[i] = i; } int Find(int a) { return a == f[a] ? a : f[a] = Find(f[a]); } void Union(int a, int b) { a = Find(a); b = Find(b); if (a != b) { f[a] = b; w[b] += w[a]; } } int main() { int n, m; while(~scanf("%d%d", &n, &m)) { UFInit(n); for(int i = 0; i < n; i++) scanf("%d", &w[i]); for(int i = 0; i < m; i++) { int u, v; scanf("%d%d", &u, &v); Union(u, v); } int i; for(i = 0; i < n; i++) if(w[Find(i)] != 0) break; puts(i == n ? "POSSIBLE" : "IMPOSSIBLE"); } return 0; }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
compilation terminated.


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-27 03:41:09, Gzip enabled