結果

問題 No.1594 Three Classes
ユーザー NSNS
提出日時 2021-07-10 12:05:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 525 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 158,340 KB
最終ジャッジ日時 2023-08-10 07:00:23
合計ジャッジ時間 6,212 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 308 ms
158,216 KB
testcase_01 AC 68 ms
71,200 KB
testcase_02 AC 69 ms
71,352 KB
testcase_03 AC 230 ms
158,320 KB
testcase_04 AC 309 ms
158,288 KB
testcase_05 AC 311 ms
158,340 KB
testcase_06 AC 230 ms
158,232 KB
testcase_07 AC 232 ms
158,196 KB
testcase_08 AC 311 ms
158,268 KB
testcase_09 AC 310 ms
158,180 KB
testcase_10 AC 304 ms
158,036 KB
testcase_11 AC 316 ms
158,208 KB
testcase_12 AC 316 ms
158,192 KB
testcase_13 AC 68 ms
71,324 KB
testcase_14 AC 251 ms
158,280 KB
testcase_15 AC 250 ms
158,160 KB
testcase_16 AC 118 ms
98,384 KB
testcase_17 AC 222 ms
157,988 KB
testcase_18 AC 67 ms
71,452 KB
testcase_19 AC 76 ms
76,488 KB
testcase_20 AC 81 ms
76,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
al=list(map(int, input().split()))

from itertools import product
ite = list(product(range(3),repeat=n))
for pattern in ite:
    bl=[0]*3
    for i, v in enumerate(pattern):
        bl[v]+=al[i]
    bl.sort()
    if bl[0]==bl[2]:
        print('Yes')
        exit()
print('No')
0