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_39412213_8189.cpp:17:5: error: 'vector' does not name a type
   17 |     vector<int> parent;
      |     ^~~~~~
0_0_39412213_8189.cpp: In constructor 'UnionFind::UnionFind(int)':
0_0_39412213_8189.cpp:21:13: error: 'parent' was not declared in this scope
   21 |             parent.push_back(i);
      |             ^~~~~~
0_0_39412213_8189.cpp: In member function 'int UnionFind::find(int)':
0_0_39412213_8189.cpp:26:18: error: 'parent' was not declared in this scope
   26 |         if (x != parent[x]) {
      |                  ^~~~~~
0_0_39412213_8189.cpp:29:16: error: 'parent' was not declared in this scope
   29 |         return parent[x];
      |                ^~~~~~
0_0_39412213_8189.cpp: In member function 'void UnionFind::unity(int, int)':
0_0_39412213_8189.cpp:36:9: error: 'parent' was not declared in this scope
   36 |         parent[x] = y;
      |         ^~~~~~
0_0_39412213_8189.cpp: In member function 'int UnionFind::count()':
0_0_39412213_8189.cpp:48:29: error: 'parent' was not declared in this scope
   48 |         for (int i = 0; i < parent.size(); ++i) {
      |                             ^~~~~~
0_0_39412213_8189.cpp: At global scope:
0_0_39412213_8189.cpp:57:13: error: 'vector' was not declared in this scope
   57 | int krustal(vector<Edge> edges, int vertices) {
      |             ^~~~~~
0_0_39412213_8189.cpp:57:24: error: expected primary-expression before '>' token
   57 | int krustal(vector<Edge> edges, int vertices) {
      |                        ^
0_0_39412213_8189.cpp:57:26: error: 'edges' was not declared in this scope
   57 | int krustal(vector<Edge> edges, int vertices) {
      |                          ^~~~~
0_0_39412213_8189.cpp:57:33: error: expected primary-expression before 'int'
   57 | int krustal(vector<Edge> edges, int vertices) {
      |                                 ^~~
0_0_39412213_8189.cpp:57:45: error: expression list treated as compound expression in initializer [-fpermissive]
   57 | int krustal(vector<Edge> edges, int vertices) {
      |                                             ^
0_0_39412213_8189.cpp: In function 'int main()':
0_0_39412213_8189.cpp:75:10: error: 'std::ios' has not been declared
   75 |     std::ios::sync_with_stdio(false);
      |          ^~~
0_0_39412213_8189.cpp:76:10: error: 'cin' is not a member of 'std'
   76 |     std::cin.tie(nullptr);
      |          ^~~
0_0_39412213_8189.cpp:1:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
  +++ |+#include <iostream>
    1 | class Edge {
0_0_39412213_8189.cpp:77:10: error: 'cout' is not a member of 'std'
   77 |     std::cout.tie(nullptr);
      |          ^~~~
0_0_39412213_8189.cpp:77:10: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
0_0_39412213_8189.cpp:80:12: error: 'cin' was not declared in this scope
   80 |     while (cin >> vertices) {
      |            ^~~
0_0_39412213_8189.cpp:87:9: error: 'vector' was not declared in this scope
   87 |         vector<Edge> edges;
      |         ^~~~~~
0_0_39412213_8189.cpp:87:20: error: expected primary-expression before '>' token
   87 |         vector<Edge> edges;
      |                    ^
0_0_39412213_8189.cpp:87:22: error: 'edges' was not declared in this scope
   87 |         vector<Edge> edges;
      |                      ^~~~~
0_0_39412213_8189.cpp:96:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   96 |         sort(edges.begin(), edges.end());
      |         ^~~~
      |         short
0_0_39412213_8189.cpp:98:9: error: 'cout' was not declared in this scope
   98 |         cout << krustal(edges, vertices) << endl;
      |         ^~~~
0_0_39412213_8189.cpp:98:24: error: 'krustal' cannot be used as a function
   98 |         cout << krustal(edges, vertices) << endl;
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~
0_0_39412213_8189.cpp:98:45: error: 'endl' was not declared in this scope
   98 |         cout << krustal(edges, vertices) << endl;
      |                                             ^~~~


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-23 03:55:42, Gzip enabled