結果
問題 | No.2924 <===Super Spaceship String===> |
ユーザー |
![]() |
提出日時 | 2024-10-12 16:24:50 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 77 ms / 2,000 ms |
コード長 | 304 bytes |
コンパイル時間 | 169 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 83,132 KB |
最終ジャッジ日時 | 2024-10-16 17:55:30 |
合計ジャッジ時間 | 1,508 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
S=input().strip() ans = len(S) stack = [] for s in S: if s=="<": stack.append(1) elif s=="=": if stack: stack[-1] += 1 else: if stack: if stack[-1]>1: ans-=stack.pop()+1 else: stack.clear() print(ans)