Ticket #7502: quadratic.cpp
File quadratic.cpp, 473 bytes (added by , 10 years ago) |
---|
Line | |
---|---|
1 | #include <iostream> |
2 | #include <boost/graph/adjacency_list.hpp> |
3 | #include <boost/graph/boyer_myrvold_planar_test.hpp> |
4 | using namespace std; |
5 | using namespace boost; |
6 | |
7 | typedef adjacency_list<vecS, vecS, undirectedS> Graph; |
8 | |
9 | int main() { |
10 | int N; |
11 | cin >> N; |
12 | |
13 | Graph G(N+2); |
14 | for (int u = 1; u <= N; ++u) |
15 | add_edge(0, u, G); |
16 | for (int u = 1; u < N; ++u) |
17 | add_edge(u, u+1, G); |
18 | for (int u = 0; u <=N; ++u) |
19 | add_edge(u, N+1, G); |
20 | cout << boyer_myrvold_planarity_test(G) << "\n"; |
21 | } |