結果

問題 No.1594 Three Classes
ユーザー ShirotsumeShirotsume
提出日時 2021-07-09 21:31:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 351 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 8,248 KB
最終ジャッジ日時 2023-09-14 07:54:52
合計ジャッジ時間 26,847 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 15 ms
7,928 KB
testcase_02 AC 14 ms
8,072 KB
testcase_03 AC 65 ms
8,208 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 AC 61 ms
8,104 KB
testcase_07 AC 126 ms
8,248 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 AC 14 ms
8,100 KB
testcase_14 AC 560 ms
8,104 KB
testcase_15 AC 311 ms
8,068 KB
testcase_16 AC 157 ms
8,244 KB
testcase_17 AC 109 ms
8,072 KB
testcase_18 AC 14 ms
8,164 KB
testcase_19 AC 22 ms
7,808 KB
testcase_20 AC 30 ms
8,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

e = list(map(int,input().split()))

for i in range(3 ** n):
    a = 0
    b = 0
    c = 0
    for j in range(n):
        if i % 3 == 0:
            a += e[j]
        if i % 3 == 1:
            b += e[j]
        if i % 3 == 2:
            c += e[j]
        i //= 3
    if a == b == c:
        print("Yes")
        exit()

print("No")
0