結果

問題 No.2397 ω冪
ユーザー googol_S0googol_S0
提出日時 2022-11-18 00:48:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,281 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,556 KB
実行使用メモリ 78,528 KB
最終ジャッジ日時 2023-10-19 15:02:10
合計ジャッジ時間 5,086 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,352 KB
testcase_01 AC 39 ms
53,352 KB
testcase_02 AC 38 ms
53,352 KB
testcase_03 AC 39 ms
53,352 KB
testcase_04 AC 39 ms
53,352 KB
testcase_05 AC 39 ms
53,352 KB
testcase_06 AC 38 ms
53,352 KB
testcase_07 AC 39 ms
53,352 KB
testcase_08 AC 37 ms
53,352 KB
testcase_09 AC 37 ms
53,352 KB
testcase_10 AC 37 ms
53,352 KB
testcase_11 AC 37 ms
53,352 KB
testcase_12 AC 36 ms
53,352 KB
testcase_13 AC 37 ms
53,352 KB
testcase_14 WA -
testcase_15 AC 36 ms
53,352 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 40 ms
53,352 KB
testcase_20 AC 38 ms
53,352 KB
testcase_21 AC 37 ms
53,352 KB
testcase_22 WA -
testcase_23 AC 37 ms
53,352 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 37 ms
53,352 KB
testcase_27 WA -
testcase_28 AC 37 ms
53,352 KB
testcase_29 WA -
testcase_30 AC 37 ms
53,352 KB
testcase_31 AC 38 ms
53,352 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 38 ms
53,352 KB
testcase_35 AC 45 ms
59,424 KB
testcase_36 AC 238 ms
78,528 KB
testcase_37 AC 201 ms
77,520 KB
testcase_38 WA -
testcase_39 AC 221 ms
77,400 KB
testcase_40 AC 59 ms
70,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=input()
M=input()
assert(1<=len(N))
assert(len(N)<=100000)
assert(1<=len(M))
assert(len(M)<=100000)
assert((N=='0')or(N[0]!='0'))
assert((N=='0')or(N[0]!='0'))
assert((M=='0')or(M[0]!='0'))

S='0,1,w,2,w^w,w+1,w,3,w^2,w^(w)+1,w2,w+2,w^w,w+1,w,4,w^w^w'
S=S.split(',')
X=[0,1,5,2,10,6,5,3,9,11,8,7,10,6,5,4,12]
X=[X[i]+1 for i in range(len(X))]
def f(N):
  A=[]
  b=0
  while N:
    if N&1:
      v=X[b]
      while len(A)>0 and A[-1][0]<v:
        del A[-1]
      if len(A)>0 and A[-1][0]==v:
        A[-1]=(A[-1][0],A[-1][1]+1)
      else:
        A.append((v,1))
      b=0
    else:
      b+=1
    N>>=1
  return tuple(A)

def ord_then(X,Y):
  for i in range(min(len(X),len(Y))):
    if X[i]>Y[i]:
      return -1
    if X[i]<Y[i]:
      return 1
  if len(X)>len(Y):
    return -1
  if len(X)<len(Y):
    return 1
  return  0

b=0
A=[]
for i in range(len(N)-1,-1,-1):
  if N[i]=='0':
    b+=1
  else:
    v=f(b)
    while len(A)>0:
      if ord_then(A[-1],v)==1:
        del A[-1]
      else:
        break
    A.append(v)
    b=0
b=0
B=[]
for i in range(len(M)-1,-1,-1):
  if M[i]=='0':
    b+=1
  else:
    v=f(b)
    while len(B)>0:
      if ord_then(B[-1],v)==1:
        del B[-1]
      else:
        break
    B.append(v)
    b=0
if A<B:
  print('Yes')
else:
  print('No')
0