結果

問題 No.1594 Three Classes
ユーザー Akijin_007Akijin_007
提出日時 2022-10-21 14:37:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 679 ms / 2,000 ms
コード長 552 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 79,076 KB
最終ジャッジ日時 2023-09-13 15:50:44
合計ジャッジ時間 9,028 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 675 ms
78,920 KB
testcase_01 AC 75 ms
71,164 KB
testcase_02 AC 70 ms
71,484 KB
testcase_03 AC 142 ms
78,968 KB
testcase_04 AC 679 ms
79,076 KB
testcase_05 AC 670 ms
78,916 KB
testcase_06 AC 85 ms
76,928 KB
testcase_07 AC 129 ms
78,676 KB
testcase_08 AC 670 ms
78,800 KB
testcase_09 AC 664 ms
79,052 KB
testcase_10 AC 669 ms
78,936 KB
testcase_11 AC 671 ms
78,808 KB
testcase_12 AC 676 ms
78,936 KB
testcase_13 AC 72 ms
71,364 KB
testcase_14 AC 186 ms
78,940 KB
testcase_15 AC 176 ms
78,876 KB
testcase_16 AC 149 ms
78,780 KB
testcase_17 AC 139 ms
79,016 KB
testcase_18 AC 73 ms
71,224 KB
testcase_19 AC 107 ms
78,720 KB
testcase_20 AC 116 ms
77,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = int(input())
A = list(map(int, input().split()))

def base10int(value, base):
    if (int(value / base)):
        return base10int(int(value / base), base) + str(value % base)
    return str(value % base)

ans = 0

for i in range(3 ** N):
    b = base10int(i, 3)
    b = format(b, ">0" + str(N))
    p = [0] * 3
    for j in range(N):
        p[int(b[j])] += A[j]
    if min(p) == max(p):
        ans = 1
        break

if ans == 1:
    print("Yes")
else:
    print("No")

0