結果
| 問題 | 
                            No.805 UMG
                             | 
                    
| コンテスト | |
| ユーザー | 
                             minaruco
                         | 
                    
| 提出日時 | 2021-11-21 01:36:16 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 191 bytes | 
| コンパイル時間 | 443 ms | 
| コンパイル使用メモリ | 81,736 KB | 
| 実行使用メモリ | 71,680 KB | 
| 最終ジャッジ日時 | 2024-11-18 14:13:23 | 
| 合計ジャッジ時間 | 2,617 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 RE * 19 | 
ソースコード
ans=0
n=int(input())
s=list(input())
for i in range(n):
    for j in range(i+1,n):
        k=2*j-i
        if i<j<k<=n and s[i]=="U" and s[j]=="M" and s[k]=="G":
            ans+=1
print(ans)
            
            
            
        
            
minaruco