結果

問題 No.805 UMG
ユーザー DrDrpilot
提出日時 2022-04-12 16:20:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 152 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 81,640 KB
実行使用メモリ 64,384 KB
最終ジャッジ日時 2024-11-18 14:14:52
合計ジャッジ時間 3,255 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
s=input()
ans=0
for i in range(n):
    for j in range(i+1,n):
        k=2*j-i
        if not(0<=k<n):
            continue
        if s[i]=='U' and s[j]=='M' and s[k]=='G':
            ans+=1
print(ans)
0