結果

問題 No.479 頂点は要らない
ユーザー 双六双六
提出日時 2020-08-10 04:30:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 356 ms / 1,500 ms
コード長 602 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 94,464 KB
最終ジャッジ日時 2024-04-15 20:29:27
合計ジャッジ時間 6,886 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
53,632 KB
testcase_01 AC 44 ms
53,504 KB
testcase_02 AC 44 ms
53,632 KB
testcase_03 AC 44 ms
53,504 KB
testcase_04 AC 44 ms
53,760 KB
testcase_05 AC 45 ms
53,760 KB
testcase_06 AC 49 ms
53,632 KB
testcase_07 AC 41 ms
54,016 KB
testcase_08 AC 44 ms
53,760 KB
testcase_09 AC 45 ms
53,760 KB
testcase_10 AC 43 ms
53,760 KB
testcase_11 AC 45 ms
53,760 KB
testcase_12 AC 45 ms
53,760 KB
testcase_13 AC 45 ms
54,016 KB
testcase_14 AC 44 ms
53,760 KB
testcase_15 AC 44 ms
53,504 KB
testcase_16 AC 44 ms
54,016 KB
testcase_17 AC 45 ms
53,760 KB
testcase_18 AC 46 ms
53,376 KB
testcase_19 AC 54 ms
62,336 KB
testcase_20 AC 55 ms
62,080 KB
testcase_21 AC 58 ms
61,696 KB
testcase_22 AC 54 ms
62,464 KB
testcase_23 AC 55 ms
62,080 KB
testcase_24 AC 54 ms
61,952 KB
testcase_25 AC 54 ms
61,568 KB
testcase_26 AC 353 ms
94,336 KB
testcase_27 AC 356 ms
94,464 KB
testcase_28 AC 138 ms
92,544 KB
testcase_29 AC 204 ms
89,984 KB
testcase_30 AC 201 ms
89,856 KB
testcase_31 AC 199 ms
89,856 KB
testcase_32 AC 202 ms
89,984 KB
testcase_33 AC 256 ms
88,704 KB
testcase_34 AC 284 ms
89,984 KB
testcase_35 AC 326 ms
88,064 KB
testcase_36 AC 242 ms
83,840 KB
testcase_37 AC 266 ms
89,472 KB
testcase_38 AC 243 ms
87,296 KB
testcase_39 AC 174 ms
84,224 KB
testcase_40 AC 187 ms
86,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N, M = getlist()
	edge = []
	ans = [0] * N
	for i in range(M):
		a, b = getlist()
		edge.append([a, b])

	edge.sort()

	for i in range(M):
		a, b = edge[-1 - i]
		if ans[a] == 0 and ans[b] == 0:
			ans[a] = 1

	while True:
		if ans[-1] == 0:
			ans.pop()
		else:
			break

	anspre = "".join(list(map(str, ans)))
	print(anspre[::-1])


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