結果

問題 No.1594 Three Classes
ユーザー ibukitiibukiti
提出日時 2021-10-19 15:59:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 859 ms
コンパイル使用メモリ 11,832 KB
実行使用メモリ 89,628 KB
最終ジャッジ日時 2023-10-20 10:47:35
合計ジャッジ時間 30,000 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,652 ms
89,628 KB
testcase_01 AC 28 ms
10,140 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1,755 ms
89,628 KB
testcase_05 AC 1,651 ms
89,628 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 1,682 ms
89,628 KB
testcase_09 AC 1,665 ms
89,628 KB
testcase_10 AC 1,638 ms
89,628 KB
testcase_11 AC 1,669 ms
89,628 KB
testcase_12 AC 1,677 ms
89,628 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 33 ms
10,364 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
n=int(input())
e=list(map(int,input().split()))
bitdp=list(itertools.product([0,1,2],repeat=n))
t=0
for bit in bitdp:
    bitlis=list(bit)
    ans0=0
    ans1=0
    ans2=0
    for bi in bitlis:
        if bi==0:
            ans0+=bi
        elif bi==1:
            ans1+=bi
        else:
            ans2+=bi
    if ans0==(sum(e)/3) and ans1==(sum(e)/3):
        print("Yes")
        t=1
        break
if t==0:
    print("No")
0