結果

問題 No.805 UMG
ユーザー NagisaNagisa
提出日時 2019-03-22 22:50:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 454 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 76,560 KB
最終ジャッジ日時 2023-08-11 19:19:36
合計ジャッジ時間 4,168 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,672 KB
testcase_01 AC 73 ms
75,712 KB
testcase_02 AC 73 ms
71,268 KB
testcase_03 AC 72 ms
75,592 KB
testcase_04 AC 72 ms
71,392 KB
testcase_05 AC 68 ms
71,340 KB
testcase_06 AC 69 ms
71,336 KB
testcase_07 AC 73 ms
75,752 KB
testcase_08 AC 72 ms
76,136 KB
testcase_09 AC 73 ms
75,700 KB
testcase_10 AC 69 ms
71,072 KB
testcase_11 AC 70 ms
71,296 KB
testcase_12 AC 69 ms
71,440 KB
testcase_13 AC 71 ms
75,768 KB
testcase_14 AC 69 ms
71,072 KB
testcase_15 AC 77 ms
76,496 KB
testcase_16 AC 78 ms
76,552 KB
testcase_17 AC 76 ms
76,556 KB
testcase_18 AC 77 ms
76,208 KB
testcase_19 AC 80 ms
76,492 KB
testcase_20 AC 78 ms
76,208 KB
testcase_21 AC 78 ms
76,240 KB
testcase_22 AC 79 ms
76,552 KB
testcase_23 AC 155 ms
76,520 KB
testcase_24 AC 159 ms
76,560 KB
testcase_25 AC 160 ms
76,244 KB
testcase_26 AC 161 ms
76,100 KB
testcase_27 AC 163 ms
76,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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