結果

問題 No.479 頂点は要らない
ユーザー izryt(趣味)izryt(趣味)
提出日時 2017-01-28 07:48:10
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 82 ms / 1,500 ms
コード長 727 bytes
コンパイル時間 1,473 ms
コンパイル使用メモリ 167,992 KB
実行使用メモリ 9,416 KB
最終ジャッジ日時 2023-08-25 12:59:15
合計ジャッジ時間 4,499 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,712 KB
testcase_01 AC 3 ms
5,724 KB
testcase_02 AC 3 ms
5,732 KB
testcase_03 AC 3 ms
5,780 KB
testcase_04 AC 3 ms
5,676 KB
testcase_05 AC 3 ms
5,720 KB
testcase_06 AC 3 ms
5,712 KB
testcase_07 AC 4 ms
5,648 KB
testcase_08 AC 3 ms
5,680 KB
testcase_09 AC 3 ms
5,988 KB
testcase_10 AC 3 ms
5,652 KB
testcase_11 AC 4 ms
5,624 KB
testcase_12 AC 3 ms
5,784 KB
testcase_13 AC 4 ms
5,744 KB
testcase_14 AC 4 ms
5,656 KB
testcase_15 AC 4 ms
5,736 KB
testcase_16 AC 3 ms
5,720 KB
testcase_17 AC 3 ms
5,628 KB
testcase_18 AC 3 ms
5,996 KB
testcase_19 AC 4 ms
5,768 KB
testcase_20 AC 4 ms
5,888 KB
testcase_21 AC 3 ms
5,820 KB
testcase_22 AC 4 ms
5,760 KB
testcase_23 AC 4 ms
5,764 KB
testcase_24 AC 4 ms
5,756 KB
testcase_25 AC 4 ms
5,752 KB
testcase_26 AC 82 ms
9,000 KB
testcase_27 AC 82 ms
8,956 KB
testcase_28 AC 69 ms
9,416 KB
testcase_29 AC 69 ms
8,732 KB
testcase_30 AC 68 ms
8,732 KB
testcase_31 AC 69 ms
8,504 KB
testcase_32 AC 69 ms
8,548 KB
testcase_33 AC 69 ms
8,740 KB
testcase_34 AC 76 ms
8,976 KB
testcase_35 AC 68 ms
8,532 KB
testcase_36 AC 38 ms
7,348 KB
testcase_37 AC 75 ms
8,980 KB
testcase_38 AC 64 ms
8,548 KB
testcase_39 AC 45 ms
7,764 KB
testcase_40 AC 55 ms
8,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define rep(i,x) for(int i=0;i<x;++i)
#define rrep(i,x) for(int i=x-1;i>=0;--i)
#define rep1(i,x) for(int i=1;i<=x;++i)
#define fst first
#define scd second
#define int long long

bool used[100010];
vector<int> G[100010];

signed main()
{
    int n, m; cin >> n >> m;

    rep(i, m) {
        int a, b; cin >> a >> b;

        G[a].push_back(b);
        G[b].push_back(a);
    }

    rrep(i, n) {
        for (int to : G[i]) {
            if (used[to]) continue;

            if (to > i) {
                used[i] = true;
            }
        }
    }

    bool f = false;
    rrep(i, n) {
        if (used[i]) f = true;
        if (f) cout << used[i];
    }
    cout << endl;
}
0