結果

問題 No.805 UMG
ユーザー TakoKurageTakoKurage
提出日時 2019-03-22 21:41:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 200 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 76,536 KB
最終ジャッジ日時 2023-08-11 19:12:38
合計ジャッジ時間 4,398 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
75,740 KB
testcase_01 AC 78 ms
75,884 KB
testcase_02 AC 75 ms
71,232 KB
testcase_03 AC 77 ms
75,620 KB
testcase_04 AC 71 ms
71,284 KB
testcase_05 AC 74 ms
71,188 KB
testcase_06 AC 74 ms
71,212 KB
testcase_07 AC 76 ms
75,648 KB
testcase_08 AC 79 ms
76,168 KB
testcase_09 AC 77 ms
75,828 KB
testcase_10 AC 74 ms
71,256 KB
testcase_11 AC 74 ms
71,152 KB
testcase_12 AC 74 ms
71,284 KB
testcase_13 AC 80 ms
75,716 KB
testcase_14 AC 76 ms
71,124 KB
testcase_15 AC 88 ms
76,508 KB
testcase_16 AC 87 ms
76,152 KB
testcase_17 AC 84 ms
76,500 KB
testcase_18 AC 86 ms
76,484 KB
testcase_19 AC 85 ms
76,132 KB
testcase_20 AC 87 ms
76,536 KB
testcase_21 AC 87 ms
76,520 KB
testcase_22 AC 86 ms
76,256 KB
testcase_23 AC 202 ms
76,336 KB
testcase_24 AC 219 ms
76,340 KB
testcase_25 AC 205 ms
76,112 KB
testcase_26 AC 213 ms
76,376 KB
testcase_27 AC 224 ms
76,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

count = 0
for d in range(1, 1 + N // 2):
    for i in range(N - 2 * d):
        if (S[i], S[i + d], S[i + 2 * d]) == ('U', 'M', 'G'):
            count += 1
print(count)
0