結果

問題 No.436 ccw
ユーザー kohei2019kohei2019
提出日時 2022-01-25 00:08:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 86,536 KB
実行使用メモリ 76,120 KB
最終ジャッジ日時 2023-08-21 15:25:02
合計ジャッジ時間 3,767 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,108 KB
testcase_01 AC 69 ms
71,284 KB
testcase_02 AC 69 ms
71,164 KB
testcase_03 AC 68 ms
71,212 KB
testcase_04 AC 72 ms
71,284 KB
testcase_05 AC 69 ms
70,948 KB
testcase_06 AC 69 ms
70,800 KB
testcase_07 AC 69 ms
71,028 KB
testcase_08 AC 67 ms
71,288 KB
testcase_09 AC 70 ms
71,296 KB
testcase_10 AC 69 ms
71,056 KB
testcase_11 AC 68 ms
71,164 KB
testcase_12 AC 69 ms
71,032 KB
testcase_13 AC 69 ms
70,804 KB
testcase_14 AC 67 ms
71,188 KB
testcase_15 AC 68 ms
71,260 KB
testcase_16 AC 77 ms
75,872 KB
testcase_17 AC 74 ms
75,940 KB
testcase_18 AC 74 ms
75,500 KB
testcase_19 AC 76 ms
76,120 KB
testcase_20 AC 71 ms
75,572 KB
testcase_21 AC 80 ms
75,876 KB
testcase_22 AC 79 ms
75,808 KB
testcase_23 AC 78 ms
75,884 KB
testcase_24 AC 77 ms
75,840 KB
testcase_25 AC 76 ms
75,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = len(S)
# 右端から消すか左端から消すか
if not 'ccw' in S:
    print('0')
    exit()
ss = 'ccw'
a1 = 0
for i in range(N-2):
    if S[i:i+3] == 'ccw':
        a1 = i
a2 = N-1
for i in range(N,2,-1):
    if S[i-3:i] == 'ccw':
        a2 = i
print(min(a1+1,N-a2+1))
0