結果

問題 No.805 UMG
ユーザー O2MTO2MT
提出日時 2020-08-24 18:15:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 76,640 KB
最終ジャッジ日時 2023-08-11 19:55:07
合計ジャッジ時間 4,122 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,776 KB
testcase_01 AC 75 ms
76,000 KB
testcase_02 AC 76 ms
75,884 KB
testcase_03 AC 79 ms
75,784 KB
testcase_04 AC 72 ms
71,460 KB
testcase_05 AC 69 ms
71,088 KB
testcase_06 AC 69 ms
71,400 KB
testcase_07 AC 73 ms
75,796 KB
testcase_08 AC 75 ms
75,992 KB
testcase_09 AC 74 ms
75,944 KB
testcase_10 AC 69 ms
71,400 KB
testcase_11 AC 72 ms
75,744 KB
testcase_12 AC 67 ms
71,276 KB
testcase_13 AC 77 ms
76,072 KB
testcase_14 AC 69 ms
71,460 KB
testcase_15 AC 83 ms
76,428 KB
testcase_16 AC 81 ms
76,364 KB
testcase_17 AC 80 ms
76,460 KB
testcase_18 AC 79 ms
76,364 KB
testcase_19 AC 78 ms
76,440 KB
testcase_20 AC 84 ms
76,320 KB
testcase_21 AC 81 ms
76,640 KB
testcase_22 AC 79 ms
76,220 KB
testcase_23 AC 171 ms
76,344 KB
testcase_24 AC 160 ms
76,416 KB
testcase_25 AC 169 ms
76,256 KB
testcase_26 AC 164 ms
76,348 KB
testcase_27 AC 165 ms
76,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = str(input())
count = 0
for i in range(N-2):
  for j in range(i+1,N-1):
    if 2*j-i >= N:
      continue
    if S[i] == "U" and S[j] == "M" and S[2*j-i] == "G":
      count += 1
print(count)
0