結果

問題 No.805 UMG
ユーザー MaboyMaboy
提出日時 2021-06-25 19:38:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 536 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 7,996 KB
最終ジャッジ日時 2023-08-11 20:00:21
合計ジャッジ時間 4,446 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,812 KB
testcase_01 AC 15 ms
7,956 KB
testcase_02 AC 15 ms
7,932 KB
testcase_03 AC 17 ms
7,884 KB
testcase_04 AC 15 ms
7,996 KB
testcase_05 AC 15 ms
7,796 KB
testcase_06 AC 15 ms
7,956 KB
testcase_07 AC 16 ms
7,884 KB
testcase_08 AC 15 ms
7,880 KB
testcase_09 AC 15 ms
7,824 KB
testcase_10 AC 15 ms
7,836 KB
testcase_11 AC 15 ms
7,888 KB
testcase_12 AC 15 ms
7,880 KB
testcase_13 AC 15 ms
7,800 KB
testcase_14 AC 15 ms
7,828 KB
testcase_15 AC 29 ms
7,796 KB
testcase_16 AC 28 ms
7,892 KB
testcase_17 AC 23 ms
7,828 KB
testcase_18 AC 34 ms
7,820 KB
testcase_19 AC 21 ms
7,896 KB
testcase_20 AC 32 ms
7,880 KB
testcase_21 AC 25 ms
7,952 KB
testcase_22 AC 27 ms
7,808 KB
testcase_23 AC 512 ms
7,836 KB
testcase_24 AC 525 ms
7,960 KB
testcase_25 AC 536 ms
7,880 KB
testcase_26 AC 523 ms
7,884 KB
testcase_27 AC 531 ms
7,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
v = 0
c = 0
while c < N-1:
    c = S.find("U",c)
    if c < 0:break
    for i in range(0,(N-c-3)//2+1):
        if S[c+i+1] != "M":
            continue
        elif S[c+i*2+2] == "G":
            v += 1
    c += 1
print(v)
0