結果

問題 No.1594 Three Classes
ユーザー lemonlemon
提出日時 2021-07-10 00:09:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,893 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-28 00:34:48
合計ジャッジ時間 17,862 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,749 ms
10,752 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 26 ms
10,624 KB
testcase_03 AC 100 ms
10,624 KB
testcase_04 AC 1,743 ms
10,752 KB
testcase_05 AC 1,787 ms
10,752 KB
testcase_06 AC 26 ms
10,624 KB
testcase_07 AC 62 ms
10,752 KB
testcase_08 AC 1,764 ms
10,624 KB
testcase_09 AC 1,740 ms
10,624 KB
testcase_10 AC 1,893 ms
10,752 KB
testcase_11 AC 1,783 ms
10,752 KB
testcase_12 AC 1,803 ms
10,752 KB
testcase_13 AC 27 ms
10,624 KB
testcase_14 AC 265 ms
10,752 KB
testcase_15 AC 237 ms
10,624 KB
testcase_16 AC 124 ms
10,624 KB
testcase_17 AC 97 ms
10,624 KB
testcase_18 AC 27 ms
10,624 KB
testcase_19 AC 30 ms
10,624 KB
testcase_20 AC 39 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, itertools

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()


for i in itertools.product(range(3), repeat=n):
    A = [0] * 3
    for j, p in enumerate(i):
        A[p] += E[j]
    if len(set(A)) == 1:
        print('Yes')
        exit()

print('No')
0