結果

問題 No.1594 Three Classes
ユーザー machoniumpmachoniump
提出日時 2021-07-23 20:36:56
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 711 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 76,632 KB
最終ジャッジ日時 2024-04-28 00:42:14
合計ジャッジ時間 7,677 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 40 ms
52,468 KB
testcase_02 AC 40 ms
53,236 KB
testcase_03 AC 317 ms
76,168 KB
testcase_04 AC 639 ms
76,464 KB
testcase_05 AC 638 ms
76,532 KB
testcase_06 AC 68 ms
70,064 KB
testcase_07 AC 359 ms
76,548 KB
testcase_08 AC 645 ms
76,632 KB
testcase_09 AC 644 ms
76,384 KB
testcase_10 AC 640 ms
76,440 KB
testcase_11 AC 642 ms
76,444 KB
testcase_12 AC 655 ms
76,268 KB
testcase_13 AC 56 ms
65,900 KB
testcase_14 AC 297 ms
76,548 KB
testcase_15 AC 307 ms
76,328 KB
testcase_16 AC 155 ms
76,556 KB
testcase_17 AC 348 ms
76,560 KB
testcase_18 AC 40 ms
53,540 KB
testcase_19 AC 81 ms
76,472 KB
testcase_20 AC 100 ms
76,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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