Skip to content

Instantly share code, notes, and snippets.

@yumechi
Created December 17, 2015 05:11
Show Gist options
  • Save yumechi/1440ee320ca36de60db9 to your computer and use it in GitHub Desktop.
Save yumechi/1440ee320ca36de60db9 to your computer and use it in GitHub Desktop.
マヨイドーロ問題提出プログラム
inp = gets.to_i
y, z = 0, 1
a, b = 2, 3
for i in 1..inp do
if i % 2 == 1
y += a
a += b
else
z += b
b += a
end
end
puts y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment