結果

問題 No.111 あばばばば
ユーザー Takuya NoguchiTakuya Noguchi
提出日時 2018-03-09 23:20:43
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 185 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 821,120 KB
最終ジャッジ日時 2024-04-19 02:47:11
合計ジャッジ時間 8,458 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
12,032 KB
testcase_01 AC 99 ms
11,904 KB
testcase_02 AC 172 ms
22,144 KB
testcase_03 RE -
testcase_04 AC 148 ms
12,160 KB
testcase_05 AC 340 ms
45,056 KB
testcase_06 AC 1,451 ms
212,096 KB
testcase_07 MLE -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s = Array.new(gets.to_i) { |i|
  i.even? ? 'a' : 'b'
}

a_num = (s[2..-1] || []).count('a')
b_num = (s[3..-1] || []).count('b')

puts 1.upto(a_num).inject(:+) + 1.upto(b_num).inject(:+)
0