Skip to content

Instantly share code, notes, and snippets.

View junichiro's full-sized avatar

Junichiro Tobe junichiro

  • Novasell
  • Tokyo, Japan
View GitHub Profile
@junichiro
junichiro / q1198.go
Created January 28, 2015 02:48
code_iq:1198
package main
import (
"fmt"
"strconv"
)
func main() {
CodeIq()
}
@junichiro
junichiro / q1208.py
Created January 28, 2015 02:49
code_iq: 1208
# -*- coding: utf-8 -*-
import sys
class code_iq:
prime_numbers = []
def do(self, a, x):
if a == 0 and x == 0:
@junichiro
junichiro / q1217.py
Created January 28, 2015 02:49
code_iq: 1217
# -*- coding: utf-8 -*-
class code_iq:
def do(self, n):
_max = ()
for v in self.prime_numbers(n):
if self.is_kai(v):
_max = v,
print _max[0]
@junichiro
junichiro / q1220.pl
Created January 28, 2015 02:50
code_iq: 1220
for(1..25){for$i(1..25){print(($_==$i)?chr(65+$_):'A')}print"\n"}
@junichiro
junichiro / q1235.py
Created January 28, 2015 02:50
code_iq: 1235
# -*- coding: utf-8 -*-
import random
class code_iq:
def _moves(self, a, b):
u"""1桁の正の整数を2つ与えると動く玉の数を返す"""
if a > b:
a, b = b, a
@junichiro
junichiro / q1236.py
Created January 28, 2015 02:51
code_iq: 1236
# -*- coding: utf-8 -*-
class code_iq:
def do(self, n):
res = []
for v in range(1, n + 1):
if v % 3 == 0 and v % 5 == 0:
res.append('Fizz Buzz')
elif v % 3 == 0:
@junichiro
junichiro / q1237.py
Created January 28, 2015 02:51
code_iq: 1237
# -*- coding: utf-8 -*-
class code_iq:
prime_numbers = []
def do(self, keta = 4):
_min, _max = 10**(keta-1), 10**keta
self.prime_numbers = self.prime_numbers(int(_max ** 0.5) + 1)
for n in range(_min, _max):
@junichiro
junichiro / q1239.go
Created January 28, 2015 02:52
code_iq: 1239
package main
import (
"fmt"
"os"
)
func main() {
v := GetInput()
fmt.Println(v)
@junichiro
junichiro / q1241.py
Created January 28, 2015 02:53
code_iq: 1241
# -*- coding: utf-8 -*-
class code_iq:
def get_kai_insu_cnt(self, n):
if n > 2:
i2, io = 0, 0
a = self.get_insu_cnt(n)
b = self.get_kai_insu_cnt(n - 1)
return (a[0] + b[0], a[1] + b[1])
@junichiro
junichiro / rsa.py
Created January 28, 2015 02:53
code_iq: rsa
# -*- coding: utf-8 -*-
class code_iq:
def do(self, n = 100):
prime_numbers = self.prime_numbers(n)
for p in prime_numbers:
for q in prime_numbers:
if p >= q:
continue