| Task: | Alien Invasion II |
| Sender: | lnan95 |
| Submission time: | 2020-09-19 15:50:47 +0300 |
| Language: | Python3 (CPython3) |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | RUNTIME ERROR | 0.02 s | details |
| #2 | RUNTIME ERROR | 0.02 s | details |
| #3 | RUNTIME ERROR | 0.02 s | details |
Code
import math
import sympy
flag = 0
def isPrime(num):
sqr = int(math.sqrt(num))+1
for i in range(2, sqr+1):
if num % i == 0:
return i
return -1
def bfs(num, depth, length):
global flag
if flag==1:
return
if depth == 2:
return
for i in range(1,10):
m = i*int(math.pow(10, length)) + num
if sympy.isprime(m):
pass
else:
r = isPrime(m)
if r != -1 and flag != 1:
flag = 1
print (m)
print (r, int(m/r), sep=" ")
return
for i in range(1,10):
m = i*int(math.pow(10, length)) + num
bfs(m, depth+1, length+1)
if __name__ == "__main__":
n = int(input())
length = 0
r = isPrime(n)
if r != -1:
flag = 1
print (n)
print (r, int(n/r), sep=" ")
n_cp = n
while (n_cp > 0):
n_cp = n_cp // 10
length += 1
bfs(n, 0, length)
Test details
Test 1
Verdict: RUNTIME ERROR
| input |
|---|
| 2368469234876449 |
| correct output |
|---|
| 22368469234876449 3 7456156411625483 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 2, in <module>
import...Test 2
Verdict: RUNTIME ERROR
| input |
|---|
| 292929292929292929292929292931 |
| correct output |
|---|
| 129292929292929292929292929293... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 2, in <module>
import...Test 3
Verdict: RUNTIME ERROR
| input |
|---|
| 292929292929292929292929292979 |
| correct output |
|---|
| 129292929292929292929292929297... |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 2, in <module>
import...