#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ALL(a) (a).begin(), (a).end() using ll = long long; using P = pair; struct State { int v, cost; State(int v, int cost): v(v), cost(cost) {} // 昇順 bool operator<(const State& s) const { return cost < s.cost; } // 降順 bool operator>(const State& s) const { return cost > s.cost; } }; void dump_vector(vector vec) { for (int i = 0; i < vec.size(); i++) { cout << vec[i] << (i < vec.size() - 1 ? " " : "\n"); } } const int MAX_N = 100010; const int MAX_M = 100010; struct Edge { int to, id; }; vector edges[MAX_N]; bool v_used[MAX_M]; int main() { int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { int a, b; cin >> a >> b; edges[a].push_back((Edge){b, i}); edges[b].push_back((Edge){a, i}); } for (int v = n - 1; v >= 0; v--) { for (Edge e : edges[v]) { if (v_used[v] || v_used[e.to]) continue; // どっちも使われていないなら v_used[min(v, e.to)] = true; // cout << "#: " << e.to << endl; } } bool first = true; for (int i = n - 1; i >= 0; i--) { if (v_used[i]) { first = false; cout << 1; } else if (!first) { cout << 0; } } cout << endl; return 0; }