Last active
August 29, 2015 14:19
-
-
Save parrot-studio/fe12bfe45208a07dca1b to your computer and use it in GitHub Desktop.
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
https://paiza.jp/poh/enshura |
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
puts gets.chars.each.with_index.select{|c, i| i.even?}.map(&:first).join |
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
rsl = [0,0,0,0,0,0,0] | |
gets.to_i.times do |i| | |
break unless str = gets | |
rsl[i % 7] += str.to_i | |
end | |
puts rsl.join("\n") |
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
w, h = gets.split(' ').map(&:to_i) | |
counts = Hash.new(0) | |
h.times do | |
nums = gets.split(' ').map(&:to_i) | |
nums.each.with_index(1) do |n, i| | |
next unless n == 1 | |
counts[i] += 1 | |
end | |
end | |
h.times do |i| | |
list = [] | |
(1..w).each do |x| | |
list << (counts[x] >= (h-i) ? 1 : 0) | |
end | |
puts list.join(' ') | |
end |
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
w, h, n = gets.split(' ').map(&:to_i) | |
table = [] | |
h.times do | |
gets.split(' ').map(&:to_i).each{|n| table << n} | |
end | |
all = 0 | |
n.times do | |
sx, sy, ex, ey = gets.split(' ').map(&:to_i) | |
(sy..ey).each do |y| | |
break if y > h | |
(sx..ex).each do |x| | |
break if x > w | |
ind = w * (y-1) + (x-1) | |
all += table[ind] | |
table[ind] = 0 | |
end | |
end | |
end | |
puts all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
レナルート: https://paiza.jp/poh/enshura-rena-ending/5db8bd8c