Problem:


Divisor

Problem

12以下の自然数 N が与えられるので、約数の個数がちょうど N 個であるような最小の自然数を求めよ。

Input

1つの自然数 N が 1 行で与えられる。

Constraints

1 ≤ N ≤ 12

Output

約数の個数がちょうど N 個であるような最小の自然数を1行に出力せよ。

Sample Input 1

1

Sample Output 1

1

Sample Input 2

2

Sample Output 2

2

Sample Input 3

3

Sample Output 3

4



Sample input:
1


Sample output:
1

Submission status: Wrong Answer

Solution code:
def solve(n):
	for i in range(1,100):
		cnt=0
		for j in range(1,100):
			if i%j==0:
				cnt+=1
				if cnt==n:
					return(i)
n=int(input())
print(solve(n))

Submission status: Wrong Answer

Solution code:
def solve(n):
	for i in range(1,100):
		cnt=0
		for j in range(1,100):
			if i%j==0:
				cnt+=1
				if cnt==n:
					return(i)
while True:
	try:
		n=int(input())
		print(solve(n))
	except EOFError:break

Submission status: Wrong Answer

Solution code:
def solve(n):
	for i in range(1,100):
		cnt=0
		for j in range(1,100):
			if i%j==0:
				cnt+=1
		if cnt==n:
			return(i)
while True:
	try:
		n=int(input())
		print(solve(n))
	except EOFError:break

Submission status: Wrong Answer

Solution code:
def solve(n):
	for i in range(1,100):
		cnt=0
		for j in range(1,100):
			if i%j==0:
				cnt+=1
		if cnt==n:
			return(i)

n=int(input())
print(solve(n))

Submission status: Wrong Answer

Solution code:
def solve(n):
	for i in range(1,100):
		cnt=0
		for j in range(1,i+1):
			if i%j==0:
				cnt+=1
		if cnt==n:
			return(i)

n=int(input())
print(solve(n))

Submission status: Wrong Answer

Solution code:
def solve(n):
	for i in range(1,100):
		cnt=0
		for j in range(1,i+1):
			if i%j==0:
				cnt+=1
		if cnt==n:
			return(i)
while True:
	try:
		n=int(input())
		print(solve(n))
	except EOFError:
		break

Submission status: Wrong Answer

Solution code:
print([0,1,2,4,6,16,12,64,30,36,48,1024,60][int(input())])

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())
i = 1
num = [0] * 13

while True:
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1
    if cnt >= 12:
        i += 1
        continue

    if num[cnt] == 0:
        num[cnt] = i

    if num[n] > 0:
        ans = num[n]
        break

    i += 1

print(ans)

Submission status: Accepted

Solution code:
# AOJ 1562: Divisor
# Python3 2018.7.13 bal4u

ans = [0, 1, 2, 4, 6, 16, 12, 64, 24, 36, 48, 1024, 60] 
print(ans[int(input())])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def f(n):
    ret = 0
    for a in range(1, n+1):
        if n % a == 0:
            ret += 1
    return ret

N = int(input())
n = 1
while True:
    if f(n) == N:
        print(n)
        break
    n += 1

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())
i = 1
num = [0] * 13

while True:
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1

    if cnt > 12:
        i += 1
        continue

    if num[cnt] == 0:
        num[cnt] = i

    if num[n] > 0:
        ans = num[n]
        break

    i += 1

print(ans)

Submission status: Accepted

Solution code:
def solve(n):
	for i in range(1,10000):
		cnt=0
		for j in range(1,i+1):
			if i%j==0:
				cnt+=1
		if cnt==n:
			return(i)
while True:
	try:
		n=int(input())
		print(solve(n))
	except EOFError:
		break

Submission status: Accepted

Solution code:
print([1,2,4,6,16,12,64,24,36,48,1024,60][int(input())-1])

Submission status: Accepted

Solution code:
print([0,1,2,4,6,16,12,64,24,36,48,1024,60][int(input())])

Submission status: Accepted

Solution code:
N = int(input())
target = 1
while True:
    count = 0
    for i in range(1, target+1):
        if target % i == 0:
            count += 1
    if count == N:
        print(target)
        break
    target += 1

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n = int(input())
i = 1
num = [0] * 13 #num[i] -> ?´???°???i???????????°??§????°??????°

while True:
    cnt = 0
    for j in range(1, i+1):
        if i % j == 0:
            cnt += 1

    if num[cnt] == 0:
        num[cnt] = i

    if num[n] > 0:
        ans = num[n]
        break

    i += 1

print(ans)