This file contains hidden or 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
sudo apt update | |
sudo apt upgrade | |
sudo apt install build-essential gdb | |
sudo add-apt-repository ppa:damien-moore/codeblocks-stable | |
sudo apt-get update | |
sudo apt install codeblocks |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# https://www.v2ex.com/t/342485 | |
dp = [1,1,0] | |
p = [1,0,0] | |
key = gets.to_i | |
(key-1).times do | i | | |
p[0],p[1],p[2] = p[0]+p[1]+p[2]+dp[0]+dp[1]+dp[2],p[0],p[1] | |
dp[0],dp[1],dp[2] = dp[0]+dp[1]+dp[2],dp[0],dp[1] |