結果

問題 No.1594 Three Classes
コンテスト
ユーザー lllllll88938494
提出日時 2023-06-01 01:19:55
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 65 ms / 2,000 ms
+ 150µs
コード長 265 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 276 ms
コンパイル使用メモリ 81,944 KB
実行使用メモリ 83,448 KB
最終ジャッジ日時 2026-10-09 01:59:07
合計ジャッジ時間 2,936 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import product
n=int(input())
a = list(map(int,input().split()))
cnt = 0
for p in product([0,1,2],repeat = n):
    t = [0]*3
    for i in range(n):
        t[p[i]] += a[i]

    if t[0] == t[1] == t[2]:
        print('Yes')
        exit()

print('No')
0