結果

問題 No.805 UMG
ユーザー oz4point5oz4point5
提出日時 2019-03-30 20:23:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 511 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2023-08-11 19:30:10
合計ジャッジ時間 4,259 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,976 KB
testcase_01 AC 78 ms
75,668 KB
testcase_02 AC 69 ms
71,228 KB
testcase_03 AC 72 ms
75,864 KB
testcase_04 AC 69 ms
71,056 KB
testcase_05 AC 70 ms
71,432 KB
testcase_06 AC 69 ms
71,252 KB
testcase_07 AC 72 ms
75,912 KB
testcase_08 AC 72 ms
76,088 KB
testcase_09 AC 71 ms
75,840 KB
testcase_10 AC 68 ms
71,444 KB
testcase_11 AC 67 ms
71,392 KB
testcase_12 AC 68 ms
71,536 KB
testcase_13 AC 74 ms
75,820 KB
testcase_14 AC 69 ms
71,232 KB
testcase_15 AC 80 ms
76,280 KB
testcase_16 AC 78 ms
76,500 KB
testcase_17 AC 76 ms
76,412 KB
testcase_18 AC 78 ms
76,464 KB
testcase_19 AC 76 ms
76,408 KB
testcase_20 AC 80 ms
76,392 KB
testcase_21 AC 77 ms
76,532 KB
testcase_22 AC 79 ms
76,544 KB
testcase_23 AC 145 ms
76,520 KB
testcase_24 AC 139 ms
76,220 KB
testcase_25 AC 142 ms
76,356 KB
testcase_26 AC 137 ms
76,512 KB
testcase_27 AC 140 ms
76,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

n = int(input())
s = input()

ans = 0

for i in range(n):
    for j in range(i+1,n):
        k = j + j - i
        if k >= n:
            break
        if s[i] == "U" and s[j] == "M" and s[k] == "G":
            ans += 1

print(ans)
0