結果

問題 No.805 UMG
ユーザー tsuyoiboytsuyoiboy
提出日時 2019-03-26 12:19:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 248 bytes
コンパイル時間 416 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 62,592 KB
最終ジャッジ日時 2024-04-29 10:45:37
合計ジャッジ時間 2,740 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
57,600 KB
testcase_01 AC 47 ms
58,496 KB
testcase_02 AC 41 ms
51,968 KB
testcase_03 AC 44 ms
57,088 KB
testcase_04 AC 42 ms
51,456 KB
testcase_05 AC 41 ms
51,712 KB
testcase_06 AC 41 ms
51,712 KB
testcase_07 AC 45 ms
57,472 KB
testcase_08 AC 46 ms
58,240 KB
testcase_09 AC 45 ms
58,112 KB
testcase_10 AC 41 ms
51,456 KB
testcase_11 AC 41 ms
51,840 KB
testcase_12 AC 41 ms
51,456 KB
testcase_13 AC 46 ms
58,624 KB
testcase_14 AC 41 ms
51,584 KB
testcase_15 AC 54 ms
61,056 KB
testcase_16 AC 53 ms
60,544 KB
testcase_17 AC 53 ms
60,544 KB
testcase_18 AC 54 ms
60,288 KB
testcase_19 AC 53 ms
60,800 KB
testcase_20 AC 56 ms
61,056 KB
testcase_21 AC 53 ms
60,416 KB
testcase_22 AC 53 ms
60,672 KB
testcase_23 AC 121 ms
62,208 KB
testcase_24 AC 112 ms
62,336 KB
testcase_25 AC 125 ms
62,336 KB
testcase_26 AC 114 ms
62,592 KB
testcase_27 AC 131 ms
62,080 KB
権限があれば一括ダウンロードができます

ソースコード

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":
            if S[i+d]=="M" and S[i+2*d]=="G":
                ans+=1
print(ans)
0