Skip to content

Instantly share code, notes, and snippets.

@lithtle
lithtle / taxi_fee.rb
Last active August 29, 2015 14:19
"第30回オフラインリアルタイムどう書くの問題" 解いてみた ref: http://qiita.com/lithtle/items/25f465f7a28393f99755
# encoding: sjis
#
# とある世界のタクシー料金を計算する
# Author:: lithtle
# Created_At:: 2015-04-21
# Link:: http://nabetani.sakura.ne.jp/hena/ord30taxi/
# 都市の地点と経路
CITY = {
@lithtle
lithtle / answer.rb
Created May 25, 2015 08:56
「Five programming problems every Software Engineer should be able to solve in less than 1 hour」をrubyで解いてみた
# encoding: sjis
# 1
# using for
def sum_for(list)
sum = 0
for i in list
sum += i
end
sum
@lithtle
lithtle / main.rb
Last active September 23, 2021 03:52
目標ろんめんぺいになるまでどれだけCEを周回すればいいのか
# deepcopyに必要なやつ
require 'active_support'
require 'active_support/core_ext'
# 目標ろんめんぺい金額
START = 808888
GOAL = 888888
# 各種CEで取得可能な金額とラベル
PATTERN = {