結果

問題 No.1594 Three Classes
ユーザー Keroru
提出日時 2021-07-10 15:04:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 592 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 191,940 KB
最終ジャッジ日時 2024-11-16 08:27:20
合計ジャッジ時間 10,036 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

def bit_combination(n,base=2):
    rt=[]
    for tb in range(base**n):s=[tb//(base**bt)%base for bt in range(n)];rt+=[s]
    return rt

n=int(input())
e=[int(i)for i in input().split()]
f=1
for x in bit_combination(n,3):
    a=[0]*3
    for i in range(n):a[x[i]]+=e[i]
    if len(set(a))==1:f=0
print('YNeos'[f::2])
0