結果

問題 No.1594 Three Classes
ユーザー tassei903tassei903
提出日時 2021-07-09 21:35:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 874 ms
コンパイル使用メモリ 86,844 KB
実行使用メモリ 77,068 KB
最終ジャッジ日時 2023-08-10 06:43:29
合計ジャッジ時間 3,846 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
76,672 KB
testcase_01 AC 73 ms
71,292 KB
testcase_02 AC 74 ms
71,216 KB
testcase_03 AC 83 ms
76,164 KB
testcase_04 AC 137 ms
76,772 KB
testcase_05 AC 139 ms
76,824 KB
testcase_06 AC 77 ms
76,672 KB
testcase_07 AC 81 ms
76,676 KB
testcase_08 AC 141 ms
76,600 KB
testcase_09 AC 138 ms
76,620 KB
testcase_10 AC 136 ms
76,620 KB
testcase_11 AC 136 ms
77,068 KB
testcase_12 AC 137 ms
76,728 KB
testcase_13 AC 75 ms
71,332 KB
testcase_14 AC 88 ms
76,596 KB
testcase_15 AC 88 ms
76,856 KB
testcase_16 AC 82 ms
76,196 KB
testcase_17 AC 81 ms
76,332 KB
testcase_18 AC 75 ms
71,428 KB
testcase_19 AC 79 ms
76,376 KB
testcase_20 AC 78 ms
76,316 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