結果

問題 No.805 UMG
ユーザー kamojirokamojiro
提出日時 2019-03-22 21:36:02
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 187 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 76,380 KB
最終ジャッジ日時 2023-08-11 19:11:23
合計ジャッジ時間 4,165 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,692 KB
testcase_01 AC 78 ms
75,364 KB
testcase_02 AC 75 ms
71,208 KB
testcase_03 AC 80 ms
75,756 KB
testcase_04 AC 73 ms
71,256 KB
testcase_05 AC 75 ms
71,148 KB
testcase_06 AC 74 ms
71,240 KB
testcase_07 AC 77 ms
75,312 KB
testcase_08 AC 79 ms
76,280 KB
testcase_09 AC 77 ms
75,684 KB
testcase_10 AC 73 ms
71,464 KB
testcase_11 AC 74 ms
71,392 KB
testcase_12 AC 75 ms
71,052 KB
testcase_13 AC 79 ms
75,788 KB
testcase_14 AC 74 ms
71,372 KB
testcase_15 AC 85 ms
76,028 KB
testcase_16 AC 84 ms
76,256 KB
testcase_17 AC 83 ms
76,348 KB
testcase_18 AC 84 ms
76,104 KB
testcase_19 AC 83 ms
76,068 KB
testcase_20 AC 83 ms
76,188 KB
testcase_21 AC 82 ms
76,264 KB
testcase_22 AC 85 ms
76,196 KB
testcase_23 AC 161 ms
76,268 KB
testcase_24 AC 169 ms
76,324 KB
testcase_25 AC 165 ms
76,324 KB
testcase_26 AC 165 ms
76,224 KB
testcase_27 AC 165 ms
76,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int( input())
S = input()
ans = 0
for i in range(1,(N+1)//2):
    for j in range(N-2*i):
        if S[j] == "U" and S[j+i] == "M" and S[j+2*i] == "G":
            ans += 1
print(ans)
0