結果

問題 No.805 UMG
ユーザー dangodango
提出日時 2023-06-15 20:54:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 120 ms / 2,000 ms
コード長 171 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 77,188 KB
最終ジャッジ日時 2023-09-05 23:44:50
合計ジャッジ時間 4,798 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,356 KB
testcase_01 AC 67 ms
76,012 KB
testcase_02 AC 71 ms
71,428 KB
testcase_03 AC 70 ms
75,768 KB
testcase_04 AC 62 ms
71,260 KB
testcase_05 AC 63 ms
71,536 KB
testcase_06 AC 63 ms
71,200 KB
testcase_07 AC 63 ms
71,536 KB
testcase_08 AC 64 ms
71,356 KB
testcase_09 AC 63 ms
71,432 KB
testcase_10 AC 64 ms
71,088 KB
testcase_11 AC 66 ms
71,220 KB
testcase_12 AC 64 ms
71,384 KB
testcase_13 AC 64 ms
71,228 KB
testcase_14 AC 64 ms
71,416 KB
testcase_15 AC 70 ms
75,804 KB
testcase_16 AC 73 ms
76,160 KB
testcase_17 AC 71 ms
75,884 KB
testcase_18 AC 72 ms
76,312 KB
testcase_19 AC 68 ms
76,008 KB
testcase_20 AC 72 ms
75,996 KB
testcase_21 AC 69 ms
76,556 KB
testcase_22 AC 71 ms
76,088 KB
testcase_23 AC 120 ms
77,024 KB
testcase_24 AC 108 ms
76,708 KB
testcase_25 AC 107 ms
77,188 KB
testcase_26 AC 106 ms
77,140 KB
testcase_27 AC 106 ms
77,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
A = 0
for i in range(N):
  if S[i] == "M":
    for j in range(1, min(i, N - 1 - i) + 1):
      if S[i - j] + S[i + j] == "UG": A += 1
print(A)
0