Submission #10087007
Source Code Expand
n = int(input()) prime_factors = [] def is_prime(n): sqrt_n = n ** 0.5 if n == 0 or n == 1: return False if n == 2: return True i = 2 while i < sqrt_n: if n % i == 0: return False i += 1 return True prime_factors = [] original = n if is_prime(n): prime_factors.append(n) else: i = 2 while n > 1 and i <= original: if n % i == 0: prime_factors.append(i) n //= i else: i += 1 def myfunc(a, b): if len(str(a)) > len(str(b)): return len(str(a)) return len(str(b)) nums = [] t = 1 MIN = len(str(original)) for p in prime_factors: original //= p nums.append((original, p * t)) MIN = min(MIN, myfunc(original, p * t)) t *= p print(MIN)
Submission Info
Submission Time | |
---|---|
Task | C - Digits in Multiplication |
User | tiruka |
Language | PyPy3 (2.4.0) |
Score | 0 |
Code Size | 842 Byte |
Status | WA |
Exec Time | 2106 ms |
Memory | 40044 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | AC | 178 ms | 38512 KB |
sample_02.txt | AC | 181 ms | 38256 KB |
sample_03.txt | AC | 183 ms | 38512 KB |
subtask_1_1.txt | AC | 175 ms | 38256 KB |
subtask_1_10.txt | WA | 173 ms | 38256 KB |
subtask_1_11.txt | AC | 173 ms | 38512 KB |
subtask_1_12.txt | AC | 186 ms | 38512 KB |
subtask_1_2.txt | WA | 178 ms | 38256 KB |
subtask_1_3.txt | AC | 180 ms | 38256 KB |
subtask_1_4.txt | AC | 190 ms | 38896 KB |
subtask_1_5.txt | AC | 204 ms | 40044 KB |
subtask_1_6.txt | AC | 543 ms | 40044 KB |
subtask_1_7.txt | TLE | 2106 ms | 40044 KB |
subtask_1_8.txt | WA | 179 ms | 38384 KB |
subtask_1_9.txt | AC | 176 ms | 38512 KB |