結果

問題 No.2021 Not A but B
ユーザー simansiman
提出日時 2022-07-30 08:32:20
言語 Ruby
(3.3.0)
結果
MLE  
実行時間 -
コード長 233 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 11,416 KB
実行使用メモリ 817,840 KB
最終ジャッジ日時 2023-09-27 09:35:52
合計ジャッジ時間 5,568 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,244 KB
testcase_01 AC 76 ms
15,128 KB
testcase_02 AC 77 ms
15,148 KB
testcase_03 AC 75 ms
15,276 KB
testcase_04 AC 75 ms
15,160 KB
testcase_05 AC 75 ms
15,112 KB
testcase_06 AC 75 ms
15,040 KB
testcase_07 AC 73 ms
15,152 KB
testcase_08 MLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
S = gets.chomp
s = S.dup

checked = Hash.new
ans = 0

0.upto(N - 2) do |i|
  s[i] = 'B'
  s[i + 1] = 'B'

  if not checked[s]
    checked[s] = true
    ans += 1
  end

  s[i] = S[i]
  s[i + 1] = S[i + 1]

end

puts ans
0