結果

問題 No.1594 Three Classes
ユーザー tassei903tassei903
提出日時 2021-07-09 21:35:12
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 1,145 ms
使用メモリ 81,396 KB
最終ジャッジ日時 2022-12-17 01:39:40
合計ジャッジ時間 4,854 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 146 ms
81,280 KB
testcase_01 AC 82 ms
75,528 KB
testcase_02 AC 83 ms
75,532 KB
testcase_03 AC 94 ms
80,728 KB
testcase_04 AC 146 ms
80,980 KB
testcase_05 AC 144 ms
81,120 KB
testcase_06 AC 89 ms
80,860 KB
testcase_07 AC 90 ms
80,884 KB
testcase_08 AC 148 ms
81,176 KB
testcase_09 AC 146 ms
81,268 KB
testcase_10 AC 145 ms
81,036 KB
testcase_11 AC 145 ms
81,396 KB
testcase_12 AC 147 ms
81,168 KB
testcase_13 AC 85 ms
75,760 KB
testcase_14 AC 100 ms
80,992 KB
testcase_15 AC 99 ms
81,172 KB
testcase_16 AC 99 ms
81,012 KB
testcase_17 AC 91 ms
80,856 KB
testcase_18 AC 80 ms
75,768 KB
testcase_19 AC 86 ms
80,728 KB
testcase_20 AC 87 ms
81,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes")
no = lambda :print("no");No = lambda :print("No")
#######################################################################
n = ni()
e = na()
from itertools import product

for i in product(range(3),repeat=n):
    a =[ 0,0,0]
    for j in range(n):
        a[i[j]]+=e[j]
    if a[0]==a[1]==a[2]:
        Yes()
        exit()
No()
0