結果

問題 No.805 UMG
ユーザー anagohirameanagohirame
提出日時 2019-03-22 21:51:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 76,468 KB
最終ジャッジ日時 2023-08-11 19:13:16
合計ジャッジ時間 3,853 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,332 KB
testcase_01 AC 75 ms
75,780 KB
testcase_02 AC 75 ms
71,204 KB
testcase_03 AC 76 ms
75,612 KB
testcase_04 AC 78 ms
71,204 KB
testcase_05 AC 74 ms
71,208 KB
testcase_06 AC 74 ms
71,260 KB
testcase_07 AC 75 ms
71,136 KB
testcase_08 AC 75 ms
71,212 KB
testcase_09 AC 74 ms
71,228 KB
testcase_10 AC 74 ms
71,304 KB
testcase_11 AC 74 ms
71,304 KB
testcase_12 AC 73 ms
71,320 KB
testcase_13 AC 75 ms
71,296 KB
testcase_14 AC 72 ms
71,088 KB
testcase_15 AC 82 ms
75,832 KB
testcase_16 AC 83 ms
76,464 KB
testcase_17 AC 80 ms
75,816 KB
testcase_18 AC 82 ms
75,736 KB
testcase_19 AC 79 ms
75,588 KB
testcase_20 AC 82 ms
75,748 KB
testcase_21 AC 80 ms
76,352 KB
testcase_22 AC 83 ms
76,468 KB
testcase_23 AC 117 ms
76,252 KB
testcase_24 AC 111 ms
76,340 KB
testcase_25 AC 112 ms
76,160 KB
testcase_26 AC 111 ms
76,244 KB
testcase_27 AC 112 ms
76,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
ans = 0
for i in range(n):
    if s[i] == "M":
        for j in range(1, min(i+1, n-i)):
            if s[i-j] == "U" and s[i+j] == "G":
                ans += 1
print(ans)
0