結果

問題 No.1594 Three Classes
ユーザー machoniumpmachoniump
提出日時 2021-07-23 20:36:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,384 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 14,756 KB
最終ジャッジ日時 2023-09-25 19:50:40
合計ジャッジ時間 7,619 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 33 ms
10,340 KB
testcase_02 AC 33 ms
10,460 KB
testcase_03 TLE -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, defaultdict,Counter
from copy import deepcopy
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement,accumulate
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians, ceil, floor, log, sqrt, ceil, floor, pi, hypot
from string import ascii_lowercase
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
sys.setrecursionlimit(1000000)
INF = 10**12
MOD = 10**9+7
# MOD = 998244353
yes="Yes"
no="No"
#|
from random import randint
def II():return int(input())
def SI():return str(input())
def MI():return map(int,input().split())
def MS():return map(str,input().split())
def LI():return list(map(int,input().split()))
def SLI():return sorted(list(map(int,input().split())))
def LS():return list(map(str,input().split()))
def base10int(value, base):
    if (int(value / base)):
        return base10int(int(value / base), base) + str(value % base)
    return str(value % base)
n=II()
e=LI()
for i in range(3**n):
  A=0
  B=0
  C=0
  a=base10int(i,3)
  la=len(a)
  for j in range(la):
    if int(a[j])%3==0:
      A+=e[j]
    elif int(a[j])%3==1:
      B+=e[j]
    else:
      C+=e[j]
  if A==B and B==C:
    print("Yes")
    exit()
print("No")
0