Submission #32227910
Source Code Expand
from math import sqrt
def make_divisors(n):
lower_divisors, upper_divisors = [], []
i = 1
while i * i <= n:
if n % i == 0:
lower_divisors.append(i)
if i != n // i:
upper_divisors.append(n // i)
i += 1
return lower_divisors + upper_divisors[::-1]
N = int(input())
ans = 0
for i in range(1, N + 1):
d = make_divisors(i**2)
a = list(filter(lambda x: x > N, make_divisors(i**2)))
# print(len(d) - len(a) * 2)
ans += len(d) - len(a) * 2
print(ans)
Submission Info
| Submission Time | |
|---|---|
| Task | D - Together Square |
| User | gae1202 |
| Language | PyPy3 (7.3.0) |
| Score | 0 |
| Code Size | 536 Byte |
| Status | TLE |
| Exec Time | 2208 ms |
| Memory | 73688 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 400 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt |
| All | example_00.txt, example_01.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 74 ms | 62000 KiB |
| example_01.txt | AC | 62 ms | 69424 KiB |
| test_00.txt | TLE | 2207 ms | 73564 KiB |
| test_01.txt | TLE | 2207 ms | 73572 KiB |
| test_02.txt | TLE | 2207 ms | 73608 KiB |
| test_03.txt | TLE | 2207 ms | 73564 KiB |
| test_04.txt | TLE | 2207 ms | 73596 KiB |
| test_05.txt | TLE | 2207 ms | 73468 KiB |
| test_06.txt | TLE | 2207 ms | 73688 KiB |
| test_07.txt | TLE | 2208 ms | 73612 KiB |
| test_08.txt | TLE | 2207 ms | 73460 KiB |
| test_09.txt | TLE | 2207 ms | 73564 KiB |
| test_10.txt | AC | 61 ms | 61976 KiB |
| test_11.txt | TLE | 2207 ms | 73552 KiB |