結果

問題 No.1292 パタパタ三角形
ユーザー megumeguromegumeguro
提出日時 2020-11-26 14:30:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 354 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 10,420 KB
最終ジャッジ日時 2023-10-01 03:20:42
合計ジャッジ時間 2,102 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,620 KB
testcase_01 AC 21 ms
8,788 KB
testcase_02 AC 22 ms
8,776 KB
testcase_03 AC 19 ms
8,720 KB
testcase_04 AC 20 ms
8,704 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 114 ms
10,420 KB
testcase_13 AC 116 ms
10,324 KB
testcase_14 AC 68 ms
9,100 KB
testcase_15 AC 69 ms
9,156 KB
testcase_16 AC 70 ms
9,040 KB
権限があれば一括ダウンロードができます

ソースコード

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 len(q) > 0:
        if s[i]==q[-1]:
            pass
        else:
            q.append(s[i])
            ans += 1
    """
    else:
        q.append(s[i])
        ans += 1
    """
print(ans)
0