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" | |
"strconv" | |
) | |
func main() { | |
CodeIq() | |
} |
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
# -*- coding: utf-8 -*- | |
import sys | |
class code_iq: | |
prime_numbers = [] | |
def do(self, a, x): | |
if a == 0 and x == 0: |
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
# -*- 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] |
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
for(1..25){for$i(1..25){print(($_==$i)?chr(65+$_):'A')}print"\n"} |
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
# -*- coding: utf-8 -*- | |
import random | |
class code_iq: | |
def _moves(self, a, b): | |
u"""1桁の正の整数を2つ与えると動く玉の数を返す""" | |
if a > b: | |
a, b = b, a |
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
# -*- 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: |
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
# -*- 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): |
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" | |
"os" | |
) | |
func main() { | |
v := GetInput() | |
fmt.Println(v) |
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
# -*- 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]) |
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
# -*- 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 |
OlderNewer