結果
| 問題 | No.1594 Three Classes |
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2021-07-09 21:26:09 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 125 ms / 2,000 ms |
| コード長 | 668 bytes |
| コンパイル時間 | 191 ms |
| コンパイル使用メモリ | 82,664 KB |
| 実行使用メモリ | 76,288 KB |
| 最終ジャッジ日時 | 2024-11-16 07:24:09 |
| 合計ジャッジ時間 | 2,743 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
import sys
import math
from collections import deque,Counter
#sys.setrecursionlimit(10**7)
int1=lambda x: int(x)-1
mi=lambda :map(int,input().split())
li=lambda :list(mi())
mi1=lambda :map(int1,input().split())
li1=lambda :list(mi1())
mis=lambda :map(str,input().split())
lis=lambda :list(mis())
from collections import defaultdict
"""
d=defaultdict(int) #初期値 0
d=defaultdict(lambda:1) #初期値 1
"""
mod=10**9+7
Mod=998244353
INF=10**18
ans=0
n=int(input())
a=li()
import itertools
all = itertools.product([0,1,2], repeat=n)
for x in all:
c=[0,0,0]
for i in range(n):
c[x[i]]+=a[i]
if c[0]==c[1]==c[2]:
print('Yes')
exit()
print('No')
とりゐ