結果

問題 No.479 頂点は要らない
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-01-29 18:28:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 280 ms / 1,500 ms
コード長 630 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 87,036 KB
実行使用メモリ 93,780 KB
最終ジャッジ日時 2023-08-25 15:08:04
合計ジャッジ時間 8,953 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,316 KB
testcase_01 AC 73 ms
71,248 KB
testcase_02 AC 73 ms
71,500 KB
testcase_03 AC 70 ms
71,528 KB
testcase_04 AC 70 ms
71,272 KB
testcase_05 AC 73 ms
71,400 KB
testcase_06 AC 70 ms
71,384 KB
testcase_07 AC 71 ms
71,080 KB
testcase_08 AC 70 ms
71,112 KB
testcase_09 AC 71 ms
71,412 KB
testcase_10 AC 71 ms
71,276 KB
testcase_11 AC 72 ms
71,404 KB
testcase_12 AC 71 ms
71,220 KB
testcase_13 AC 71 ms
71,256 KB
testcase_14 AC 73 ms
71,512 KB
testcase_15 AC 71 ms
71,268 KB
testcase_16 AC 70 ms
71,224 KB
testcase_17 AC 70 ms
71,220 KB
testcase_18 AC 70 ms
71,088 KB
testcase_19 AC 104 ms
75,976 KB
testcase_20 AC 89 ms
76,020 KB
testcase_21 AC 87 ms
75,804 KB
testcase_22 AC 88 ms
76,168 KB
testcase_23 AC 90 ms
76,068 KB
testcase_24 AC 86 ms
76,060 KB
testcase_25 AC 84 ms
75,452 KB
testcase_26 AC 275 ms
91,664 KB
testcase_27 AC 280 ms
91,592 KB
testcase_28 AC 203 ms
93,780 KB
testcase_29 AC 198 ms
84,676 KB
testcase_30 AC 196 ms
84,852 KB
testcase_31 AC 199 ms
84,596 KB
testcase_32 AC 196 ms
84,676 KB
testcase_33 AC 234 ms
85,404 KB
testcase_34 AC 251 ms
85,660 KB
testcase_35 AC 232 ms
83,920 KB
testcase_36 AC 175 ms
80,976 KB
testcase_37 AC 247 ms
86,160 KB
testcase_38 AC 222 ms
84,396 KB
testcase_39 AC 191 ms
83,536 KB
testcase_40 AC 215 ms
85,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3


def main():
    n, m = (int(x) for x in input().split())
    adj_vs = [[] for _ in range(n)]
    for _ in range(m):
        a, b = (int(x) for x in input().split())
        adj_vs[a].append(b)
        adj_vs[b].append(a)
    for vs in adj_vs:
        vs.sort(reverse=True)
    needed = [False for _ in range(n)]
    for i in range(n)[::-1]:
        for j in adj_vs[i]:
            if j <= i:
                break
            elif not needed[j]:
                needed[i] = True
                break
    print("".join(str(int(x)) for x in needed[::-1]).lstrip("0"))


if __name__ == '__main__':
    main()
0