結果

問題 No.1594 Three Classes
ユーザー w0mbatw0mbat
提出日時 2021-07-09 21:40:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 77,004 KB
最終ジャッジ日時 2023-08-10 06:47:11
合計ジャッジ時間 3,904 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 156 ms
76,696 KB
testcase_01 AC 71 ms
71,032 KB
testcase_02 AC 71 ms
71,344 KB
testcase_03 AC 82 ms
76,244 KB
testcase_04 AC 162 ms
76,608 KB
testcase_05 AC 164 ms
76,340 KB
testcase_06 AC 82 ms
76,188 KB
testcase_07 AC 85 ms
76,808 KB
testcase_08 AC 165 ms
76,676 KB
testcase_09 AC 160 ms
77,004 KB
testcase_10 AC 158 ms
76,508 KB
testcase_11 AC 158 ms
76,728 KB
testcase_12 AC 158 ms
76,736 KB
testcase_13 AC 74 ms
71,324 KB
testcase_14 AC 93 ms
76,940 KB
testcase_15 AC 89 ms
76,844 KB
testcase_16 AC 86 ms
76,692 KB
testcase_17 AC 81 ms
76,664 KB
testcase_18 AC 74 ms
71,312 KB
testcase_19 AC 81 ms
76,296 KB
testcase_20 AC 80 ms
76,260 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