結果
問題 |
No.1594 Three Classes
|
ユーザー |
|
提出日時 | 2021-07-23 20:36:56 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 165 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 76,944 KB |
最終ジャッジ日時 | 2024-11-16 08:31:22 |
合計ジャッジ時間 | 7,571 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 1 |
ソースコード
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")