結果

問題 No.164 ちっちゃくないよ!!
ユーザー zeroyonichihachizeroyonichihachi
提出日時 2016-11-07 16:50:35
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 292 bytes
コンパイル時間 65 ms
コンパイル使用メモリ 11,380 KB
実行使用メモリ 15,480 KB
最終ジャッジ日時 2023-08-16 14:20:36
合計ジャッジ時間 1,983 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,188 KB
testcase_01 AC 78 ms
15,292 KB
testcase_02 AC 78 ms
15,164 KB
testcase_03 AC 79 ms
15,160 KB
testcase_04 AC 77 ms
15,108 KB
testcase_05 AC 85 ms
15,308 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 82 ms
15,384 KB
testcase_09 WA -
testcase_10 AC 77 ms
15,064 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

DIC = Hash[
  (Array("0".."9") + Array("A".."Z")).
  map.with_index.to_a
]

def conv(s, b=36)
  s.chars.reverse.
    map.with_index{|c, i| DIC[c] * b ** i}.
    reduce(&:+)
end

gets.to_i.times.
  map{ gets.chomp }.
  min_by{|s| conv(s) }.
  tap{|min| p conv(min, DIC[min.chars.max].succ) }

0