結果
| 問題 | No.2924 <===Super Spaceship String===> |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-12 15:40:58 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 574 bytes |
| 記録 | |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 118,656 KB |
| 最終ジャッジ日時 | 2026-04-29 17:15:10 |
| 合計ジャッジ時間 | 1,771 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 2 RE * 2 |
ソースコード
from sys import stdin
def main():
s = stdin.readline().rstrip()
last_str = []
flag = False
for c in s:
last_str.append(c)
if len(last_str) < 2:
continue
if not flag and last_str[-2] == '<' and last_str[-1] == '=':
flag = True
if flag and last_str[-1] == '<':
flag = False
if flag and last_str[-1] == '>':
while last_str[-1] != '<':
last_str.pop()
last_str.pop()
print(len(last_str))
return
if __name__ == "__main__":
main()