結果

問題 No.805 UMG
ユーザー tpynerivertpyneriver
提出日時 2019-03-22 21:33:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 583 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 76,528 KB
最終ジャッジ日時 2023-08-11 19:10:03
合計ジャッジ時間 3,828 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,108 KB
testcase_01 AC 79 ms
71,296 KB
testcase_02 AC 75 ms
71,296 KB
testcase_03 AC 75 ms
71,412 KB
testcase_04 AC 74 ms
71,396 KB
testcase_05 AC 73 ms
71,264 KB
testcase_06 AC 74 ms
71,280 KB
testcase_07 AC 74 ms
71,084 KB
testcase_08 AC 75 ms
71,208 KB
testcase_09 AC 76 ms
71,324 KB
testcase_10 AC 76 ms
71,300 KB
testcase_11 AC 76 ms
71,088 KB
testcase_12 AC 74 ms
71,012 KB
testcase_13 AC 73 ms
71,276 KB
testcase_14 AC 75 ms
71,296 KB
testcase_15 AC 84 ms
76,528 KB
testcase_16 AC 81 ms
75,676 KB
testcase_17 AC 80 ms
75,968 KB
testcase_18 AC 82 ms
75,716 KB
testcase_19 AC 79 ms
75,376 KB
testcase_20 AC 81 ms
75,836 KB
testcase_21 AC 85 ms
75,800 KB
testcase_22 AC 83 ms
75,912 KB
testcase_23 AC 115 ms
76,124 KB
testcase_24 AC 114 ms
76,508 KB
testcase_25 AC 116 ms
76,128 KB
testcase_26 AC 116 ms
76,296 KB
testcase_27 AC 118 ms
76,180 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
ans = 0
for i, v in enumerate(S):
    if v != 'U':
        continue
    for k in range(1, (N+1-i)//2):
        if S[i+k] == 'M' and S[i+2*k] == 'G':
            ans += 1
print(ans)
0