結果

問題 No.1594 Three Classes
ユーザー prd_xxxprd_xxx
提出日時 2021-07-09 21:35:50
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 497 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 87,244 KB
実行使用メモリ 76,520 KB
最終ジャッジ日時 2023-09-14 07:59:21
合計ジャッジ時間 2,768 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
76,496 KB
testcase_01 WA -
testcase_02 AC 65 ms
71,292 KB
testcase_03 AC 66 ms
71,148 KB
testcase_04 AC 67 ms
71,200 KB
testcase_05 AC 71 ms
76,220 KB
testcase_06 AC 64 ms
71,132 KB
testcase_07 AC 67 ms
71,092 KB
testcase_08 WA -
testcase_09 AC 71 ms
76,388 KB
testcase_10 AC 70 ms
76,320 KB
testcase_11 AC 69 ms
76,452 KB
testcase_12 AC 72 ms
76,268 KB
testcase_13 AC 65 ms
71,136 KB
testcase_14 AC 72 ms
76,164 KB
testcase_15 AC 65 ms
71,288 KB
testcase_16 AC 68 ms
75,744 KB
testcase_17 AC 62 ms
71,196 KB
testcase_18 AC 65 ms
71,132 KB
testcase_19 AC 66 ms
71,400 KB
testcase_20 AC 64 ms
70,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
E = list(map(int,input().split()))
se = sum(E)
s = se//3
if s*3 != se:
    print('No')
    exit()

for a in range(1,1<<N):
    t = 0
    for i in range(N):
        if a&(1<<i):
            t += E[i]
    if t != s: continue
    for b in range(1,1<<N):
        if a&b: continue
        if a|b == 1<<N - 1: continue
        tt = 0
        for i in range(N):
            if b&(1<<i):
                tt += E[i]
        if t==s:
            print('Yes')
            exit()
print('No')
0