結果

問題 No.805 UMG
ユーザー akitsugu777
提出日時 2019-07-09 11:12:22
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 457 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-18 13:51:09
合計ジャッジ時間 3,796 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

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

x = 0
for i in range(n):
    if s[i] == 'U':
        for j in range(i, n, 2):
            if s[j] == 'G':
                if s[(i+j)//2] == 'M':
                    x += 1

print(x)
0