結果

問題 No.1594 Three Classes
ユーザー realDivineJKrealDivineJK
提出日時 2021-07-25 16:40:17
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 1,858 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 10,536 KB
実行使用メモリ 8,224 KB
最終ジャッジ日時 2023-09-28 06:25:49
合計ジャッジ時間 18,644 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,747 ms
7,836 KB
testcase_01 AC 14 ms
7,888 KB
testcase_02 AC 13 ms
8,208 KB
testcase_03 AC 47 ms
8,080 KB
testcase_04 AC 1,742 ms
7,796 KB
testcase_05 AC 1,858 ms
7,800 KB
testcase_06 AC 48 ms
8,072 KB
testcase_07 AC 88 ms
8,208 KB
testcase_08 AC 1,756 ms
7,936 KB
testcase_09 AC 1,794 ms
7,984 KB
testcase_10 AC 1,773 ms
7,884 KB
testcase_11 AC 1,793 ms
7,744 KB
testcase_12 AC 1,766 ms
7,884 KB
testcase_13 AC 14 ms
8,164 KB
testcase_14 AC 382 ms
8,092 KB
testcase_15 AC 212 ms
8,208 KB
testcase_16 AC 119 ms
8,216 KB
testcase_17 AC 78 ms
8,092 KB
testcase_18 AC 13 ms
8,208 KB
testcase_19 AC 18 ms
7,744 KB
testcase_20 AC 24 ms
8,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = tuple(map(int, input().split()))
for i in range(3**N):
    P = [0, 0, 0]
    tmp = i
    for j in range(N):
        P[tmp%3] += A[j]
        tmp //= 3
    if P[0] == P[1] and P[1] == P[2]:
        print("Yes")
        exit()
print("No")
0