結果

問題 No.805 UMG
ユーザー oshiborioshibori
提出日時 2019-03-22 21:35:51
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 86,792 KB
実行使用メモリ 76,348 KB
最終ジャッジ日時 2023-08-11 19:11:10
合計ジャッジ時間 3,921 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,412 KB
testcase_01 AC 79 ms
75,608 KB
testcase_02 AC 74 ms
71,296 KB
testcase_03 AC 82 ms
75,688 KB
testcase_04 AC 76 ms
71,232 KB
testcase_05 AC 76 ms
71,256 KB
testcase_06 AC 74 ms
71,260 KB
testcase_07 AC 76 ms
71,136 KB
testcase_08 AC 76 ms
71,308 KB
testcase_09 AC 75 ms
71,008 KB
testcase_10 AC 76 ms
71,320 KB
testcase_11 AC 75 ms
71,252 KB
testcase_12 AC 74 ms
71,248 KB
testcase_13 AC 76 ms
71,264 KB
testcase_14 AC 75 ms
71,172 KB
testcase_15 AC 82 ms
75,624 KB
testcase_16 AC 81 ms
76,292 KB
testcase_17 AC 80 ms
75,360 KB
testcase_18 AC 83 ms
76,004 KB
testcase_19 AC 81 ms
75,540 KB
testcase_20 AC 83 ms
75,744 KB
testcase_21 AC 84 ms
76,076 KB
testcase_22 AC 83 ms
76,156 KB
testcase_23 AC 122 ms
76,348 KB
testcase_24 AC 112 ms
76,272 KB
testcase_25 AC 114 ms
76,208 KB
testcase_26 AC 113 ms
76,160 KB
testcase_27 AC 114 ms
76,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
s=input()
ans=0

for i in range(len(s)):
    if s[i]!='M':
        continue
    
    for j in range(min(i,n-i-1)):
        if s[i-1-j]=='U' and s[i+1+j]=='G':
            ans+=1 

print(ans)
0