結果

問題 No.2924 <===Super Spaceship String===>
ユーザー ルク
提出日時 2024-10-12 14:58:57
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 380 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 73,016 KB
最終ジャッジ日時 2024-10-12 14:58:58
合計ジャッジ時間 1,344 ms
ジャッジサーバーID
(参考情報)
judge2 / judge
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
r=[]
for i in range(len(s)):
  if s[i]=="<":
    r.append(["<",1])
  elif s[i]=="=":
    if r[-1][0]=="=":
      r[-1][1]+=1
    else:
      r.append(["=",1])
  else:
    if len(r)>1:
      if r[-1][0]=="=" and r[-2][0]=="<":
        r.pop()
        r.pop()
      else:
        r.append([">",1])
    else:
      r.append([">",1])
ans=0
for x in r:
  ans+=x[1]
print(ans)
0