結果

問題 No.1594 Three Classes
ユーザー SidewaysOwlSidewaysOwl
提出日時 2021-07-09 22:06:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 294 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 78,200 KB
最終ジャッジ日時 2024-04-28 00:21:08
合計ジャッジ時間 5,107 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 244 ms
77,180 KB
testcase_01 AC 34 ms
51,968 KB
testcase_02 AC 33 ms
51,968 KB
testcase_03 AC 294 ms
78,200 KB
testcase_04 AC 239 ms
76,924 KB
testcase_05 AC 241 ms
76,916 KB
testcase_06 AC 252 ms
76,696 KB
testcase_07 AC 286 ms
78,072 KB
testcase_08 AC 235 ms
77,436 KB
testcase_09 AC 239 ms
77,052 KB
testcase_10 AC 231 ms
76,920 KB
testcase_11 AC 237 ms
76,932 KB
testcase_12 AC 232 ms
77,040 KB
testcase_13 AC 47 ms
62,464 KB
testcase_14 AC 270 ms
77,828 KB
testcase_15 AC 293 ms
77,564 KB
testcase_16 AC 184 ms
77,296 KB
testcase_17 AC 276 ms
76,784 KB
testcase_18 AC 42 ms
58,368 KB
testcase_19 AC 61 ms
69,632 KB
testcase_20 AC 109 ms
76,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
e = list(map(int,input().split()))
ans = "No"
def dfs(k,l):
    global ans,n
    if k == n:
        if sum(l[0]) == sum(l[1]) == sum(l[2]):
            ans = "Yes"
        return
    for i in [0,1,2]:
        l[i][k] += e[k]
        dfs(k + 1,l[::])
        l[i][k] -= e[k]
l = [[0] * n for _ in range(3)]
dfs(0,l[::])
print(ans)
0