結果

問題 No.1594 Three Classes
ユーザー Navier_Boltzmann
提出日時 2022-02-06 16:55:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 247 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-16 08:36:04
合計ジャッジ時間 3,590 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
E = list(map(int,input().split()))
from itertools import product

A = [0]*3
def dfs(x):
    if x == N:
        if A[0]==A[1] and A[1] == A[2]:
            print('Yes')
            exit()
        else:
            return
        
    for i in range(3):
        A[i] += E[x]
        dfs(x+1)
        A[i] -= E[x]
    return
dfs(0)
print('No')
    
0