結果

問題 No.1159 Sashiming String
ユーザー 37zigen37zigen
提出日時 2020-08-19 05:18:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 183 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,752 KB
最終ジャッジ日時 2024-04-20 08:11:23
合計ジャッジ時間 2,010 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,624 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 AC 104 ms
14,592 KB
testcase_03 AC 167 ms
18,244 KB
testcase_04 AC 97 ms
14,208 KB
testcase_05 AC 141 ms
16,768 KB
testcase_06 AC 98 ms
14,208 KB
testcase_07 AC 122 ms
15,484 KB
testcase_08 AC 183 ms
18,752 KB
testcase_09 AC 175 ms
18,624 KB
testcase_10 AC 28 ms
10,624 KB
testcase_11 AC 30 ms
10,624 KB
testcase_12 AC 29 ms
10,624 KB
testcase_13 AC 29 ms
10,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S=input()
p=0
n=len(S)
s=[0]*n

for i in range(n):
    if S[i]=="S":
        s[i]+=1

for i in range(1,n):
    s[i]+=s[i-1]

ans=0
for i in range(n-2):
    if S[i:i+3]=="ing":
        ans+=s[i]
print(ans)
0