結果

問題 No.1594 Three Classes
ユーザー lllllll88938494lllllll88938494
提出日時 2023-06-01 01:19:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 77,132 KB
最終ジャッジ日時 2023-08-28 01:46:48
合計ジャッジ時間 3,743 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
77,104 KB
testcase_01 AC 71 ms
71,424 KB
testcase_02 AC 72 ms
71,664 KB
testcase_03 AC 78 ms
76,392 KB
testcase_04 AC 135 ms
77,024 KB
testcase_05 AC 135 ms
77,020 KB
testcase_06 AC 77 ms
76,680 KB
testcase_07 AC 81 ms
76,720 KB
testcase_08 AC 139 ms
76,812 KB
testcase_09 AC 135 ms
76,784 KB
testcase_10 AC 135 ms
77,012 KB
testcase_11 AC 132 ms
76,860 KB
testcase_12 AC 137 ms
77,096 KB
testcase_13 AC 71 ms
71,148 KB
testcase_14 AC 85 ms
77,132 KB
testcase_15 AC 83 ms
77,048 KB
testcase_16 AC 79 ms
76,720 KB
testcase_17 AC 78 ms
76,576 KB
testcase_18 AC 73 ms
71,608 KB
testcase_19 AC 76 ms
76,756 KB
testcase_20 AC 78 ms
76,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import product
n=int(input())
a = list(map(int,input().split()))
cnt = 0
for p in product([0,1,2],repeat = n):
    t = [0]*3
    for i in range(n):
        t[p[i]] += a[i]

    if t[0] == t[1] == t[2]:
        print('Yes')
        exit()

print('No')
0