結果

問題 No.805 UMG
ユーザー lumeffluxlumefflux
提出日時 2019-03-23 00:51:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 212 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 69,320 KB
最終ジャッジ日時 2024-04-29 10:40:49
合計ジャッジ時間 2,413 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
59,284 KB
testcase_01 AC 48 ms
58,808 KB
testcase_02 AC 36 ms
51,740 KB
testcase_03 AC 41 ms
58,048 KB
testcase_04 AC 37 ms
52,012 KB
testcase_05 AC 37 ms
51,864 KB
testcase_06 AC 37 ms
51,864 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 36 ms
53,276 KB
testcase_11 RE -
testcase_12 AC 37 ms
52,428 KB
testcase_13 AC 40 ms
59,580 KB
testcase_14 AC 37 ms
52,204 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 AC 49 ms
62,492 KB
testcase_21 RE -
testcase_22 AC 44 ms
61,200 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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