結果

問題 No.1292 パタパタ三角形
ユーザー megumeguromegumeguro
提出日時 2020-11-26 14:28:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 266 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 10,468 KB
最終ジャッジ日時 2023-10-01 03:20:40
合計ジャッジ時間 1,809 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,792 KB
testcase_01 AC 20 ms
8,704 KB
testcase_02 AC 21 ms
8,832 KB
testcase_03 RE -
testcase_04 AC 21 ms
8,640 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 WA -
testcase_08 RE -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 100 ms
10,328 KB
testcase_13 AC 98 ms
10,284 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
import math, copy, collections
from collections import deque
s =input()
n = len(s)
ans = 2
q = deque()
q.append(s[0])

for i in range(1,n):
    if s[i]==q[-1]:
        q.pop()
    else:
        q.append(s[i])
        ans += 1
    #print(q)
print(ans)
0