Created
April 27, 2012 11:32
-
-
Save nicklegr/2508543 to your computer and use it in GitHub Desktop.
GCJ ruby template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
# http://0xcc.net/ruby-bsearch/index.html.ja | |
# require './bsearch' | |
# https://github.com/kanwei/algorithms | |
# require 'rubygems' | |
# require 'algorithms' | |
# include Containers | |
def ppd(*arg) | |
if $DEBUG | |
pp(*arg) | |
end | |
end | |
def putsd(*arg) | |
if $DEBUG | |
puts(*arg) | |
end | |
end | |
def ri | |
readline.to_i | |
end | |
def ris | |
readline.split.map do |e| e.to_i end | |
end | |
def rs | |
readline.chomp | |
end | |
def rss | |
readline.chomp.split | |
end | |
def rfs | |
readline.split.map do |e| e.to_f end | |
end | |
def rws(count) | |
words = [] | |
for i in 1 .. count | |
words << readline.chomp | |
end | |
words | |
end | |
# main | |
t_start = Time.now | |
# ここから問題に応じて | |
cases = readline().to_i | |
(1 .. cases).each do |case_index| | |
# readline().chomp | |
# readline().split | |
puts "Case ##{case_index}: #{answer}" | |
# progress | |
trigger = | |
if cases >= 10 | |
case_index % (cases / 10) == 0 | |
else | |
true | |
end | |
if trigger | |
STDERR.puts("case #{case_index} / #{cases}, time: #{Time.now - t_start} s") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment