結果

問題 No.805 UMG
ユーザー oz4point5
提出日時 2019-03-30 20:23:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 925 ms
コンパイル使用メモリ 82,112 KB
実行使用メモリ 64,752 KB
最終ジャッジ日時 2024-11-18 13:37:48
合計ジャッジ時間 2,864 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

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