結果

問題 No.1594 Three Classes
ユーザー ibukitiibukiti
提出日時 2021-10-19 16:12:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 465 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 11,820 KB
実行使用メモリ 89,596 KB
最終ジャッジ日時 2023-10-20 10:48:09
合計ジャッジ時間 25,448 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 30 ms
10,036 KB
testcase_02 AC 30 ms
10,032 KB
testcase_03 AC 295 ms
89,524 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 AC 206 ms
89,524 KB
testcase_07 AC 249 ms
89,524 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 AC 30 ms
10,100 KB
testcase_14 AC 521 ms
89,524 KB
testcase_15 AC 489 ms
89,524 KB
testcase_16 AC 211 ms
33,824 KB
testcase_17 AC 284 ms
89,524 KB
testcase_18 AC 30 ms
10,052 KB
testcase_19 AC 36 ms
10,256 KB
testcase_20 AC 49 ms
12,292 KB
権限があれば一括ダウンロードができます

ソースコード

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:
    ans0=0
    ans1=0
    ans2=0
    bitlis=list(bit)
    for i in range(n):
        if bitlis[i]==0:
            ans0+=e[i]
        elif bitlis[i]==1:
            ans1+=e[i]
        else:
            ans2+=e[i]
    if ans0==(sum(e)/3) and ans1==(sum(e)/3) :
        print("Yes")
        t=1
        break
if t==0:
    print("No")
0