結果

問題 No.408 五輪ピック
ユーザー TawaraTawara
提出日時 2016-08-05 23:05:53
言語 PyPy2
(7.3.15)
結果
MLE  
実行時間 -
コード長 388 bytes
コンパイル時間 2,138 ms
コンパイル使用メモリ 76,928 KB
実行使用メモリ 88,832 KB
最終ジャッジ日時 2024-04-24 16:25:47
合計ジャッジ時間 12,210 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
75,520 KB
testcase_01 AC 86 ms
75,392 KB
testcase_02 AC 87 ms
75,136 KB
testcase_03 AC 86 ms
75,392 KB
testcase_04 AC 86 ms
75,648 KB
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
testcase_14 AC 128 ms
79,616 KB
testcase_15 MLE -
testcase_16 MLE -
testcase_17 MLE -
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 AC 125 ms
79,104 KB
testcase_22 MLE -
testcase_23 MLE -
testcase_24 MLE -
testcase_25 MLE -
testcase_26 MLE -
testcase_27 MLE -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int,raw_input().split())
E = [[] for i in xrange(N)]
for i in xrange(M):
	A,B = map(lambda x:int(x)-1,raw_input().split())
	E[A].append(B)
	E[B].append(A)
for i in xrange(N):
	E[i].sort()
def dfs(h,gone,num):
	if num == 5:
		if E[h][0] == 0:
			print "YES"
			quit()
	else:
		for nxt in E[h]:
			if nxt in gone:
				continue
			dfs(nxt,gone|{nxt},num+1)
dfs(0,{0},1)
print "NO" 
0