結果

問題 No.1594 Three Classes
ユーザー LyricalMaestro
提出日時 2024-12-10 01:02:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,032 KB
最終ジャッジ日時 2024-12-10 01:03:02
合計ジャッジ時間 2,567 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

## https://atcoder.jp/contests/abc349/tasks/abc349_e


def main():
    N = int(input())
    E = list(map(int, input().split()))

    for bit in range(3 ** N):

        p = [0, 0 ,0]
        for i in range(N):
            b = bit % 3
            p[b] += E[i]
            bit //= 3

        if p[0] == p[1] and p[1] == p[2]:
            print("Yes")
            return
        
    print("No")


    

if __name__ == "__main__":
    main()
0