示例#1
0
def solution(idx):
    N, J = map(int, util.list_input())
    util.print_case(idx, '')
    answers = linear_search(N, J)
    assert len(answers) == J
    for coin, divisors in answers:
        print coin, ' '.join(map(str, divisors))
示例#2
0
def solution(idx):
    raw = raw_input()
    word = Word()
    for c in raw:
        word.put(c)
    s = str(word)
    util.print_case(idx, s)
示例#3
0
def solution(idx):
    N, J = map(int, util.list_input())  # float_input, list_input
    util.print_case(idx, '')
    answers = linear_search(N, J)
    assert len(answers) == J
    for coin, divisors in answers:
        print coin, ' '.join(map(str, divisors))
示例#4
0
def solution(idx):
    raw = raw_input()
    word = Word()
    for c in raw:
        word.put(c)
    s = str(word)
    util.print_case(idx, s)
示例#5
0
def solution(idx):
    count = util.int_input()
    sequences = []
    for _ in range(0, count * 2 - 1):
        sequence = map(int, util.list_input())
        sequences.append(sequence)
    grid = Grid.solve(sequences)
    sol = grid.populate_missed()
    util.print_case(idx, ' '.join(map(str, sol)))
示例#6
0
def solution(idx):
    K, C, S = map(int, util.list_input())
    sequence_size = K
    complexity = C
    tester_count = S

    f = Fractal(sequence_size, complexity)
    indexset = humanize(f.search_indexset())
    if len(indexset) > tester_count:
        util.print_case(idx, 'IMPOSSIBLE')
    else:
        util.print_case(idx, ' '.join(map(str, indexset)))
示例#7
0
def solution(idx):
    count = util.int_input()
    rels = map(int, util.list_input())
    assert count == len(rels)
    circle = Circle(count)
    for i, rel in enumerate(rels):
        # #print i, rel - 1
        circle.put_rel(i, rel)
    for i, person in enumerate(circle.people):
        pass
         #print i, person
    sol = circle.search()
    util.print_case(idx, sol)
示例#8
0
def solution(idx):
    K, C, S = map(int, util.list_input())
    sequence_size = K
    complexity = C
    tester_count = S

    # K진수의 C자리 숫자(0이 패딩)에서 모든 수를 뽑는 문제와 같음
    # 한번에 C자리 뽑을 수 있으므로 C*S가 K보다 작으면 망함
    f = Fractal(sequence_size, complexity)
    indexset = humanize(f.search_indexset())
    if len(indexset) > tester_count:
        util.print_case(idx, 'IMPOSSIBLE')
    else:
        util.print_case(idx, ' '.join(map(str, indexset)))
示例#9
0
def solution(idx):
    K, C, S = map(int, util.list_input())
    sequence_size = K
    complexity = C
    tester_count = S

    # K진수의 C자리 숫자(0이 패딩)에서 모든 수를 뽑는 문제와 같음
    # 한번에 C자리 뽑을 수 있으므로 C*S가 K보다 작으면 망함
    f = Fractal(sequence_size, complexity)
    indexset = humanize(f.search_indexset())
    if len(indexset) > tester_count:
        util.print_case(idx, 'IMPOSSIBLE')
    else:
        util.print_case(idx, ' '.join(map(str, indexset)))
示例#10
0
def solution(idx):
    string = list(raw_input())
    digits = search(string)
    util.print_case(idx, digits)