結果

問題 No.805 UMG
ユーザー sinsincoscos
提出日時 2019-03-17 14:12:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 193 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,428 KB
実行使用メモリ 65,288 KB
最終ジャッジ日時 2024-11-18 13:08:46
合計ジャッジ時間 2,929 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()

ans = 0
for i in range(N):
    for j in range(N):
        if i>=j or (i+j)%2==1:
            continue
        if S[i]=='U' and S[(i+j)//2]=='M' and S[j]=='G':
            ans += 1
print(ans)
0