結果
問題 |
No.479 頂点は要らない
|
ユーザー |
![]() |
提出日時 | 2017-04-18 18:41:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 842 bytes |
コンパイル時間 | 1,444 ms |
コンパイル使用メモリ | 169,620 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 07:46:10 |
合計ジャッジ時間 | 2,744 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 11 WA * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, j) for(int i=0; i < (int)(j); i++) #define rrep(i, j) for(int i=(j)-1; i >= 0; i--) #define all(v) v.begin(),v.end() // vector template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; } class Solver { public: bool solve() { int N, M; cin >> N >> M; vector<bool> need(N); rep(i, M) { int a, b; cin >> a >> b; need[min(a, b)] = true; } reverse(all(need)); string s = ""; for(bool flg : need) { s += flg ? "1" : "0"; if(s == "0") s = ""; } cout << s << endl; return 0; } }; int main() { cin.tie(0); ios::sync_with_stdio(false); Solver s; s.solve(); return 0; }