結果

問題 No.164 ちっちゃくないよ!!
コンテスト
ユーザー gemmaro
提出日時 2020-07-15 13:09:25
言語 Ruby
(4.0.6 + ACL)
コンパイル:
ruby -w -c _filename_
実行:
ruby _filename_
結果
AC  
実行時間 64 ms / 2,000 ms
+ 451µs
コード長 564 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9 ms
コンパイル使用メモリ 9,904 KB
実行使用メモリ 14,720 KB
最終ジャッジ日時 2026-09-27 15:39:12
合計ジャッジ時間 2,306 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #
raw source code

# frozen_string_literal: true

class Integer
  def to_number
    self >= 48 && self <= 57 ? self - 48 : self - 55
  end
end

class Array
  def to_integer(base)
    size
      .times
      .to_a
      .reverse
      .map { base**_1 }
      .zip(self)
      .filter { _1 && _2 }
      .map { _1 * _2 }
      .sum
  end
end

class String
  def parse
    codepoints = chars.map { _1.ord.to_number }
    base = codepoints.max + 1
    codepoints.to_integer(base)
  end
end

def solve
  V.map { _1.parse }.min
end

N = gets.to_i
V = N.times.map { gets.chomp }

puts solve
0