Last active
February 26, 2016 02:58
-
-
Save takoika/1c90994f735015de5a09 to your computer and use it in GitHub Desktop.
バイバイマンを数えよう(https://codeiq.jp/q/2593). Python2(51), Python3(52), Go(127), Scala(96).
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
package main | |
import "fmt";func main(){a:=[200]uint64{1,1,1,1,2} | |
for i:=0;i<100;i++{fmt.Println(a[i]) | |
a[i+5]=a[i]+2*a[i+1])}} |
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
object Main extends App{var a=Seq(1L,1,1,1,2);for(i<-0 to 99){println(a(i));a=a:+a(i)+2*a(i+1)}} |
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
C=[2]+[1]*4;exec'print C[4];C=[C[4]+2*C[3]]+C;'*100 |
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
C=[2]+[1]*4;exec('print(C[4]);C=[C[4]+2*C[3]]+C;'*100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment