Skip to content

Instantly share code, notes, and snippets.

View KeyLD's full-sized avatar

Key KeyLD

View GitHub Profile
@KeyLD
KeyLD / ubuntu_init.sh
Created June 8, 2017 13:27
ubuntu initialize
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
#!/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]