Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created March 12, 2018 03:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/3d21284ecf05cad49102c5437327084d to your computer and use it in GitHub Desktop.
Save whatalnk/3d21284ecf05cad49102c5437327084d to your computer and use it in GitHub Desktop.
AtCoder ABC #090
a = gets.chomp
b = gets.chomp
c = gets.chomp
puts "#{a[0]}#{b[1]}#{c[2]}"
a, b = gets.chomp.split(" ").map(&:to_i)
ans = 0
(a..b).each do |i|
x = i.to_s
ans += 1 if x == x.reverse
end
puts ans
a, b = gets.chomp.split(" ").map(&:to_i)
if a == 1 && b == 1
puts 1
elsif a == 1 || b == 1 then
puts a * b - 2
else
puts a * b - ((a - 2 + b - 2) * 2 + 4)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment