結果

問題 No.1594 Three Classes
ユーザー kaitefkaitef
提出日時 2021-07-10 11:42:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 401 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 90,368 KB
最終ジャッジ日時 2024-04-28 00:38:15
合計ジャッジ時間 20,732 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,922 ms
90,368 KB
testcase_01 AC 27 ms
10,880 KB
testcase_02 AC 26 ms
10,752 KB
testcase_03 AC 296 ms
90,240 KB
testcase_04 TLE -
testcase_05 AC 1,829 ms
90,368 KB
testcase_06 AC 228 ms
90,368 KB
testcase_07 AC 270 ms
90,368 KB
testcase_08 TLE -
testcase_09 AC 1,959 ms
90,240 KB
testcase_10 AC 1,857 ms
90,368 KB
testcase_11 AC 1,860 ms
90,368 KB
testcase_12 TLE -
testcase_13 AC 26 ms
10,880 KB
testcase_14 AC 457 ms
90,240 KB
testcase_15 AC 431 ms
90,368 KB
testcase_16 AC 172 ms
34,560 KB
testcase_17 AC 288 ms
90,240 KB
testcase_18 AC 25 ms
10,880 KB
testcase_19 AC 30 ms
10,880 KB
testcase_20 AC 40 ms
13,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
n=int(input())
e=list(map(int,input().split()))
l=["a","b","c"]
h_list = list(itertools.product(l, repeat=n))
for h in h_list:
    a=0
    b=0
    c=0
    for i in range(n):
        if h[i]=="a":
            a+=e[i]
        elif h[i]=="b":
            b+=e[i]
        else:
            c+=e[i]
    #print(a,b,c,h)
    if a==b and b==c:
        print("Yes")
        exit()

print("No")
0