結果

問題 No.479 頂点は要らない
ユーザー H3PO4
提出日時 2020-08-22 10:49:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 293 ms / 1,500 ms
コード長 337 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 30,332 KB
最終ジャッジ日時 2024-10-15 06:51:10
合計ジャッジ時間 5,831 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import itertools

input = sys.stdin.readline

N, M = map(int, input().split())
E = [tuple(map(int, input().split())) for _ in range(M)]
E.sort(key=lambda x: -x[1])

V = [0] * N
for a, b in E:
    if not V[a] and not V[b]:
        V[a] = 1

ans = ''.join(map(str, itertools.dropwhile(lambda x: not x, reversed(V))))
print(ans)
0