結果

問題 No.805 UMG
ユーザー kawacchukawacchu
提出日時 2019-03-22 22:09:08
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 226 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 76,524 KB
最終ジャッジ日時 2023-08-11 19:16:49
合計ジャッジ時間 3,737 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,360 KB
testcase_01 AC 74 ms
75,688 KB
testcase_02 AC 72 ms
71,176 KB
testcase_03 AC 74 ms
75,764 KB
testcase_04 AC 71 ms
71,364 KB
testcase_05 AC 70 ms
71,132 KB
testcase_06 AC 70 ms
71,392 KB
testcase_07 AC 68 ms
71,536 KB
testcase_08 AC 71 ms
71,200 KB
testcase_09 AC 71 ms
71,264 KB
testcase_10 AC 71 ms
71,456 KB
testcase_11 AC 70 ms
71,256 KB
testcase_12 AC 71 ms
71,556 KB
testcase_13 AC 70 ms
71,356 KB
testcase_14 AC 73 ms
71,504 KB
testcase_15 AC 82 ms
76,148 KB
testcase_16 AC 79 ms
76,244 KB
testcase_17 AC 77 ms
75,748 KB
testcase_18 AC 77 ms
76,020 KB
testcase_19 AC 76 ms
75,772 KB
testcase_20 AC 82 ms
76,104 KB
testcase_21 AC 79 ms
76,416 KB
testcase_22 AC 78 ms
76,400 KB
testcase_23 AC 113 ms
76,524 KB
testcase_24 AC 105 ms
76,304 KB
testcase_25 AC 108 ms
76,420 KB
testcase_26 AC 111 ms
76,120 KB
testcase_27 AC 108 ms
76,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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