結果

問題 No.1594 Three Classes
ユーザー ygd.ygd.
提出日時 2021-07-31 16:56:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 377 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 76,412 KB
最終ジャッジ日時 2023-08-10 07:05:58
合計ジャッジ時間 3,365 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
76,156 KB
testcase_01 AC 68 ms
71,260 KB
testcase_02 AC 69 ms
71,248 KB
testcase_03 AC 75 ms
75,640 KB
testcase_04 AC 120 ms
76,032 KB
testcase_05 AC 120 ms
76,156 KB
testcase_06 AC 72 ms
75,556 KB
testcase_07 AC 75 ms
75,548 KB
testcase_08 AC 121 ms
76,000 KB
testcase_09 AC 117 ms
75,824 KB
testcase_10 AC 121 ms
76,272 KB
testcase_11 AC 118 ms
76,036 KB
testcase_12 AC 119 ms
76,324 KB
testcase_13 AC 69 ms
71,260 KB
testcase_14 AC 79 ms
75,964 KB
testcase_15 AC 79 ms
76,412 KB
testcase_16 AC 77 ms
75,532 KB
testcase_17 AC 75 ms
75,324 KB
testcase_18 AC 68 ms
71,308 KB
testcase_19 AC 74 ms
75,652 KB
testcase_20 AC 73 ms
75,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

def main():
    N = int(input())
    E = list(map(int,input().split()))
    A = [0,1,2]
    allL = itertools.product(A, repeat=N)
    for L in allL:
        P = [0,0,0]
        for i,x in enumerate(L):
            P[x] += E[i]
        if P[0] == P[1] == P[2]:
            print('Yes');exit() 
    print('No')

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