結果
| 問題 | No.2924 <===Super Spaceship String===> |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 14:59:44 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 85 ms / 2,000 ms |
| + 636µs | |
| コード長 | 424 bytes |
| 記録 | |
| コンパイル時間 | 78 ms |
| コンパイル使用メモリ | 80,768 KB |
| 実行使用メモリ | 118,400 KB |
| 最終ジャッジ日時 | 2026-09-19 00:02:55 |
| 合計ジャッジ時間 | 1,846 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
s=input()
r=[]
for i in range(len(s)):
if s[i]=="<":
r.append(["<",1])
elif s[i]=="=":
if len(r)==0:
r.append(["=",1])
elif 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)