LoginSignup
1
1

More than 5 years have passed since last update.

異星の電光掲示板 (Golf)

Last updated at Posted at 2013-11-03
問題 http://nabetani.sakura.ne.jp/hena/ord15elebubo/
Ruby/C++/Python/C http://qiita.com/cielavenir/items/3d147bdeebcadcb4e3d9
Ruby(Golf,鍋谷さんのアルゴリズム復習) http://qiita.com/cielavenir/items/732a3140efe3db571480
Swift http://qiita.com/cielavenir/items/600e264d39c402b244c1

STDOUT.sync=trueを省略するため、採点プログラムVer2を更新しました。Ver1では採点できません。
https://github.com/cielavenir/procon/commit/9f12d97099063b012cdb8fd65c296ffa81a9ee11

アルゴリズムは鍋谷さんのを使わせていただきました。
ヘッダ行除いて238バイトになりました。

[編集] ヘッダ行は不要でした。採点プログラムVer2はRuby製なので、

ruby hena_validator.rb 'ruby hena15_golf.rb' 15

のようにすれば(IO.popen()がうまいこと解釈してくれて)採点できます。

hena15_golf.rb
puts$<.map{|e|a=e.split('/').map{|e|e.to_i(16)};31.downto(0).map{|e|a[0][e]|a[1][e]*2}.join.gsub('12','102').gsub('21','201').split('0').map{|e|{'32'=>'L','31'=>'R','23'=>'J','131'=>'T','323'=>'U','313'=>'N','231'=>'S','132'=>'Z'}[e]}*''}
1
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1