結果

問題 No.1594 Three Classes
ユーザー w0mbatw0mbat
提出日時 2021-07-09 21:51:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 75,784 KB
最終ジャッジ日時 2024-04-28 00:07:59
合計ジャッジ時間 2,620 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
75,516 KB
testcase_01 AC 38 ms
51,812 KB
testcase_02 AC 39 ms
52,096 KB
testcase_03 AC 48 ms
67,456 KB
testcase_04 AC 122 ms
75,648 KB
testcase_05 AC 127 ms
75,784 KB
testcase_06 AC 49 ms
67,712 KB
testcase_07 AC 55 ms
75,392 KB
testcase_08 AC 127 ms
75,392 KB
testcase_09 AC 123 ms
75,496 KB
testcase_10 AC 119 ms
75,520 KB
testcase_11 AC 119 ms
75,648 KB
testcase_12 AC 125 ms
75,520 KB
testcase_13 AC 39 ms
52,352 KB
testcase_14 AC 67 ms
75,428 KB
testcase_15 AC 61 ms
75,548 KB
testcase_16 AC 56 ms
75,520 KB
testcase_17 AC 54 ms
75,388 KB
testcase_18 AC 39 ms
51,840 KB
testcase_19 AC 48 ms
62,336 KB
testcase_20 AC 48 ms
63,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    *E, = map(int, input().split())
    for p in range(3**N):
        G = [0 for _ in range(3)]
        for i in range(N):
            G[p % 3] += E[i]
            p //= 3
        if G[0] == G[1] == G[2]:
            print('Yes')
            return
    print('No')

if __name__ == '__main__':
    main()
0