結果

問題 No.805 UMG
ユーザー titiatitia
提出日時 2019-03-22 21:27:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 191 bytes
コンパイル時間 430 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 76,456 KB
最終ジャッジ日時 2023-08-11 19:07:42
合計ジャッジ時間 3,877 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,076 KB
testcase_01 AC 75 ms
75,688 KB
testcase_02 AC 76 ms
71,172 KB
testcase_03 AC 73 ms
75,792 KB
testcase_04 AC 69 ms
71,352 KB
testcase_05 AC 70 ms
71,088 KB
testcase_06 AC 70 ms
71,348 KB
testcase_07 AC 71 ms
71,348 KB
testcase_08 AC 71 ms
71,296 KB
testcase_09 AC 70 ms
71,304 KB
testcase_10 AC 70 ms
71,024 KB
testcase_11 AC 70 ms
71,272 KB
testcase_12 AC 69 ms
71,204 KB
testcase_13 AC 70 ms
71,152 KB
testcase_14 AC 69 ms
71,028 KB
testcase_15 AC 78 ms
75,716 KB
testcase_16 AC 79 ms
76,420 KB
testcase_17 AC 76 ms
75,504 KB
testcase_18 AC 77 ms
76,032 KB
testcase_19 AC 76 ms
75,760 KB
testcase_20 AC 78 ms
75,880 KB
testcase_21 AC 78 ms
76,408 KB
testcase_22 AC 77 ms
76,448 KB
testcase_23 AC 110 ms
76,352 KB
testcase_24 AC 104 ms
76,444 KB
testcase_25 AC 107 ms
76,296 KB
testcase_26 AC 108 ms
76,456 KB
testcase_27 AC 109 ms
76,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ANS=0
for i in range(1,N-1):
    if S[i]=="M":
        for j in range(1,min(i+1,N-i)):
            if S[i-j]=="U" and S[i+j]=="G":
                ANS+=1

print(ANS)
0