結果

問題 No.805 UMG
ユーザー ohana
提出日時 2023-10-30 15:00:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 62,592 KB
最終ジャッジ日時 2024-09-25 17:15:53
合計ジャッジ時間 2,700 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
S = list(input())

cnt = 0

for i in range(n):
    if S[i] == "M":
        for j in range(i):
            if 2 * i - j < n and (S[j], S[2 * i - j]) == ("U", "G"):
                cnt += 1

print(cnt)
0