結果

問題 No.805 UMG
ユーザー hogeandfugahogeandfuga
提出日時 2019-03-22 22:40:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 1,266 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 76,628 KB
最終ジャッジ日時 2023-08-11 19:18:54
合計ジャッジ時間 3,860 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
70,984 KB
testcase_01 AC 75 ms
75,808 KB
testcase_02 AC 73 ms
71,532 KB
testcase_03 AC 78 ms
75,768 KB
testcase_04 AC 71 ms
71,344 KB
testcase_05 AC 73 ms
71,304 KB
testcase_06 AC 70 ms
71,232 KB
testcase_07 AC 70 ms
71,412 KB
testcase_08 AC 72 ms
75,672 KB
testcase_09 AC 74 ms
75,784 KB
testcase_10 AC 71 ms
71,264 KB
testcase_11 AC 70 ms
71,376 KB
testcase_12 AC 72 ms
71,448 KB
testcase_13 AC 76 ms
75,980 KB
testcase_14 AC 71 ms
71,272 KB
testcase_15 AC 80 ms
76,132 KB
testcase_16 AC 80 ms
76,628 KB
testcase_17 AC 79 ms
75,940 KB
testcase_18 AC 82 ms
76,016 KB
testcase_19 AC 78 ms
75,944 KB
testcase_20 AC 78 ms
76,028 KB
testcase_21 AC 79 ms
76,184 KB
testcase_22 AC 80 ms
76,512 KB
testcase_23 AC 115 ms
76,420 KB
testcase_24 AC 114 ms
76,548 KB
testcase_25 AC 118 ms
76,444 KB
testcase_26 AC 115 ms
76,324 KB
testcase_27 AC 118 ms
76,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = input()
ans = 0
for k in range(n):
    if s[k] != "M":
        continue
    for i in range(k):
        if 2*k - i >= n:
            continue
        if s[i] == "U" and s[2*k-i] == "G":
            ans += 1
print(ans)
0