結果
問題 | No.1594 Three Classes |
ユーザー |
![]() |
提出日時 | 2021-07-09 22:06:26 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 317 ms / 2,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 330 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 77,948 KB |
最終ジャッジ日時 | 2024-11-16 08:17:24 |
合計ジャッジ時間 | 5,984 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
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)