/ SeriousOJ /

Record Detail

Compile Error

Traceback (most recent call last):
  File "/usr/lib/pypy3.9/py_compile.py", line 144, in compile
    code = loader.source_to_code(source_bytes, dfile or file,
  File "<builtin>/frozen importlib._bootstrap_external", line 927, in source_to_code
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "foo.py", line 1
    n, k = map(int, input().split())
IndentationError: unexpected indent

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/pypy3.9/py_compile.py", line 150, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: IndentationError: unexpected indent (foo.py, line 1)

Code

            n, k = map(int, input().split())
            # n, k, x = map(int, input().split())

            # a = [e for e in input()]
            # a = input()
            # a = list(map(int, input().split()))
            divs = []
            for i in range(2, int(n**0.5) + 1):
                if n % i < 1:
                    if is_prime(i):
                        divs.append(i)
                    d = n // i
                    if is_prime(d):
                        divs.append(d)
            divs.sort()
            x = 0
            while len(divs) > 1 and x < k:
                if x % 2 < 1:
                    n *= divs[0]
                else:
                    while n % divs[-1]:
                        divs.pop()
                    n //= divs[-1]
                x += 1
            rem = k - x
            if rem and rem % 2:
                if is_prime(n):
                    print(n * n)
                else:
                    if x % 2 < 1:
                        print(n * divs[0])
                    else:
                        print(n // divs[0])
            else:
                print(n)

Information

Submit By
Type
Submission
Problem
P1194 D. Roy and Prime Game
Contest
Happy New Year 2026
Language
PyPy 3 (Python 3.9.18 PyPy 7.3.15)
Submit At
2026-01-06 15:40:39
Judged At
2026-01-06 15:40:39
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes