Submission #32292042
Source Code Expand
def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-n**0.5//1))+1):
if temp%i==0:
cnt=0
while temp%i==0:
cnt+=1
temp //= i
arr.append([i, cnt])
if temp!=1:
arr.append([temp, 1])
if arr==[]:
arr.append([n, 1])
return arr
n = int(input())
squares = []
i = 1
while i**2 <= n:
squares.append(i**2)
i += 1
ans = 0
for i in range(1, n+1):
x = i
fact = factorization(i)
odd = 1
for a, cnt in fact:
if cnt % 2 == 1: odd *= a
for j in squares:
if odd * j > n: continue
ans += 1
print(ans)
Submission Info
| Submission Time | |
|---|---|
| Task | D - Together Square |
| User | recuraki |
| Language | PyPy3 (7.3.0) |
| Score | 400 |
| Code Size | 693 Byte |
| Status | AC |
| Exec Time | 1152 ms |
| Memory | 75156 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 400 / 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 | 68 ms | 62260 KiB |
| example_01.txt | AC | 56 ms | 65288 KiB |
| test_00.txt | AC | 339 ms | 74960 KiB |
| test_01.txt | AC | 130 ms | 74960 KiB |
| test_02.txt | AC | 204 ms | 74916 KiB |
| test_03.txt | AC | 806 ms | 74892 KiB |
| test_04.txt | AC | 106 ms | 74328 KiB |
| test_05.txt | AC | 1130 ms | 74876 KiB |
| test_06.txt | AC | 1139 ms | 74672 KiB |
| test_07.txt | AC | 1146 ms | 74924 KiB |
| test_08.txt | AC | 1145 ms | 74776 KiB |
| test_09.txt | AC | 1152 ms | 74668 KiB |
| test_10.txt | AC | 64 ms | 61876 KiB |
| test_11.txt | AC | 1138 ms | 75156 KiB |