結果

問題 No.1594 Three Classes
ユーザー ronpoo
提出日時 2023-09-25 16:49:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 82,328 KB
実行使用メモリ 75,904 KB
最終ジャッジ日時 2024-07-18 13:14:17
合計ジャッジ時間 2,319 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product

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

for comb in product(range(3),repeat=N):
    a = [0] * 3
    for x in range(N):
        a[comb[x]] += E[x]
    if a[0] == a[1] == a[2]:
        print('Yes')
        exit()
print('No')
0