結果

問題 No.1159 Sashiming String
ユーザー lllllll88938494lllllll88938494
提出日時 2023-07-08 14:19:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 261 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 77,948 KB
最終ジャッジ日時 2023-09-29 15:37:22
合計ジャッジ時間 3,156 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,296 KB
testcase_01 AC 72 ms
71,156 KB
testcase_02 AC 85 ms
76,720 KB
testcase_03 AC 83 ms
77,900 KB
testcase_04 AC 83 ms
76,728 KB
testcase_05 AC 83 ms
77,552 KB
testcase_06 AC 81 ms
76,704 KB
testcase_07 AC 82 ms
76,796 KB
testcase_08 AC 86 ms
77,948 KB
testcase_09 AC 87 ms
77,864 KB
testcase_10 AC 70 ms
71,508 KB
testcase_11 AC 68 ms
71,324 KB
testcase_12 AC 69 ms
71,148 KB
testcase_13 AC 70 ms
71,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
f = [0]*len(s)
for i in range(len(s)-2):
    if s[i] == 'i' and s[i+1] == 'n' and s[i+2] == 'g':
        f[i] = 1

for i in range(len(s)-1):
    f[i+1] += f[i]

ans = 0
for i in range(len(s)):
    if s[i] == 'S':
        ans += f[-1]-f[i]

print(ans)
0