結果

問題 No.1594 Three Classes
ユーザー w0mbatw0mbat
提出日時 2021-07-09 21:40:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 76,032 KB
最終ジャッジ日時 2024-04-28 00:05:26
合計ジャッジ時間 2,454 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
75,828 KB
testcase_01 AC 35 ms
52,224 KB
testcase_02 AC 33 ms
51,968 KB
testcase_03 AC 47 ms
67,200 KB
testcase_04 AC 109 ms
75,392 KB
testcase_05 AC 114 ms
75,536 KB
testcase_06 AC 48 ms
67,712 KB
testcase_07 AC 55 ms
75,392 KB
testcase_08 AC 111 ms
75,648 KB
testcase_09 AC 112 ms
75,520 KB
testcase_10 AC 110 ms
75,392 KB
testcase_11 AC 113 ms
75,648 KB
testcase_12 AC 108 ms
75,648 KB
testcase_13 AC 35 ms
52,096 KB
testcase_14 AC 66 ms
75,648 KB
testcase_15 AC 60 ms
75,632 KB
testcase_16 AC 56 ms
75,648 KB
testcase_17 AC 54 ms
76,032 KB
testcase_18 AC 34 ms
51,712 KB
testcase_19 AC 46 ms
62,208 KB
testcase_20 AC 45 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