結果

問題 No.479 頂点は要らない
ユーザー nebukuro09
提出日時 2017-01-27 22:55:56
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 537 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 25,344 KB
最終ジャッジ日時 2024-12-23 16:41:00
合計ジャッジ時間 6,951 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, raw_input().split())
ans = [False for i in xrange(n)]
query = [map(int, raw_input().split()) for _ in xrange(m)]
used = [False for _ in xrange(n)]
for i in xrange(m-1, -1, -1):
    a, b = query[i]
    if not used[b]:
        ans[a] = True
        used[a] = True
#print ans
print int(''.join(map(lambda x: '01'[x], reversed(ans))))
0