結果

問題 No.805 UMG
ユーザー tsuyoiboy
提出日時 2019-03-26 12:20:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 972 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-18 13:35:16
合計ジャッジ時間 6,470 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
N=int(input())
S=list(input())
ans=0
for i in range(N):#スタートの添え字
    for d in range((N-i+1)//2):
        if S[i]=="U" and S[i+d]=="M" and S[i+2*d]=="G":
            ans+=1
print(ans)
0