結果
| 問題 |
No.2924 <===Super Spaceship String===>
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-07 11:51:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 126 ms / 2,000 ms |
| コード長 | 296 bytes |
| コンパイル時間 | 175 ms |
| コンパイル使用メモリ | 82,184 KB |
| 実行使用メモリ | 99,008 KB |
| 最終ジャッジ日時 | 2024-10-16 17:52:51 |
| 合計ジャッジ時間 | 1,665 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
s=input()
d=[]
ans=len(s)
for i in s:
if i=="<":
d.append([1,0])
elif i=="=":
if len(d) and d[-1][0]:
d[-1][1]+=1
else:
d=[]
else:
if len(d) and d[-1][1]:
ans-=sum(d.pop())+1
else:
d=[]
print(ans)