結果

問題 No.1594 Three Classes
ユーザー nautnaut
提出日時 2024-01-30 14:21:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 423 ms / 2,000 ms
コード長 354 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 271,432 KB
最終ジャッジ日時 2024-01-30 14:21:50
合計ジャッジ時間 8,065 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 404 ms
271,432 KB
testcase_01 AC 34 ms
53,460 KB
testcase_02 AC 33 ms
53,460 KB
testcase_03 AC 322 ms
259,656 KB
testcase_04 AC 391 ms
271,304 KB
testcase_05 AC 393 ms
271,304 KB
testcase_06 AC 324 ms
259,656 KB
testcase_07 AC 296 ms
259,656 KB
testcase_08 AC 397 ms
271,304 KB
testcase_09 AC 423 ms
271,304 KB
testcase_10 AC 389 ms
271,304 KB
testcase_11 AC 395 ms
271,304 KB
testcase_12 AC 416 ms
271,308 KB
testcase_13 AC 38 ms
59,580 KB
testcase_14 AC 308 ms
269,256 KB
testcase_15 AC 310 ms
269,256 KB
testcase_16 AC 132 ms
135,904 KB
testcase_17 AC 318 ms
259,656 KB
testcase_18 AC 35 ms
53,460 KB
testcase_19 AC 42 ms
62,228 KB
testcase_20 AC 46 ms
72,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
E = list(map(int, input().split()))

state = [[]]

for _ in range(N):
	state_nxt = []
		
	for s in state:
		for i in range(3):
			t = s[:]
			t.append(i)
			state_nxt.append(t)

	state = state_nxt[:]

for s in state:
	p = [0, 0, 0]
	
	for i in range(N):
		p[s[i]] += E[i]
	
	if p[0] == p[1] == p[2]:
		print("Yes")
		exit()

print("No")
0