結果

問題 No.805 UMG
ユーザー lumefflux
提出日時 2019-03-23 00:51:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 212 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 71,216 KB
最終ジャッジ日時 2024-11-18 13:29:59
合計ジャッジ時間 2,242 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 RE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
cnt = 0
for i in range(N - 2):
    for j in range(i + 1, N//2 + i//2 + 1):
        k = 2 * j - i
        if S[i] == "U" and S[j] == "M"and S[k] == "G":
            cnt += 1
print(cnt)
0