結果

問題 No.1594 Three Classes
ユーザー tassei903tassei903
提出日時 2021-07-09 21:35:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 82,220 KB
実行使用メモリ 75,664 KB
最終ジャッジ日時 2024-04-28 00:01:48
合計ジャッジ時間 2,498 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
75,392 KB
testcase_01 AC 38 ms
52,224 KB
testcase_02 AC 38 ms
51,968 KB
testcase_03 AC 48 ms
65,280 KB
testcase_04 AC 107 ms
75,576 KB
testcase_05 AC 112 ms
75,520 KB
testcase_06 AC 44 ms
59,648 KB
testcase_07 AC 46 ms
62,592 KB
testcase_08 AC 109 ms
75,364 KB
testcase_09 AC 108 ms
75,664 KB
testcase_10 AC 107 ms
75,368 KB
testcase_11 AC 106 ms
75,648 KB
testcase_12 AC 106 ms
75,312 KB
testcase_13 AC 39 ms
52,224 KB
testcase_14 AC 59 ms
75,632 KB
testcase_15 AC 57 ms
75,264 KB
testcase_16 AC 49 ms
67,072 KB
testcase_17 AC 47 ms
64,256 KB
testcase_18 AC 38 ms
51,712 KB
testcase_19 AC 43 ms
59,648 KB
testcase_20 AC 44 ms
60,544 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