結果

問題 No.1594 Three Classes
ユーザー lemonlemon
提出日時 2021-07-09 23:57:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 637 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 10,856 KB
実行使用メモリ 7,916 KB
最終ジャッジ日時 2023-09-14 11:22:44
合計ジャッジ時間 28,397 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 15 ms
7,816 KB
testcase_02 AC 16 ms
7,772 KB
testcase_03 AC 67 ms
7,864 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 AC 66 ms
7,752 KB
testcase_07 AC 133 ms
7,848 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 AC 16 ms
7,916 KB
testcase_14 AC 585 ms
7,904 KB
testcase_15 AC 330 ms
7,864 KB
testcase_16 AC 165 ms
7,760 KB
testcase_17 AC 115 ms
7,756 KB
testcase_18 AC 16 ms
7,808 KB
testcase_19 AC 22 ms
7,812 KB
testcase_20 AC 34 ms
7,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
nsa = lambda: list(map(str, stdin.readline().split()))
ntp = lambda: tuple(map(int, stdin.readline().split()))
mod = 10 ** 9 + 7
inf = 10 ** 18

n = ni()
E = na()

ans = 'No'
for i in range(3 ** n):
    a, b, c = 0, 0, 0
    for j in range(n):
        if i % 3 == 0:
            a += E[j]
        if i % 3 == 1:
            b += E[j]
        if i % 3 == 2:
            c += E[j]
        i //= 3
    if a == b == c:
        ans = 'Yes'
        break

print(ans)
0