Submission #68784946
Source Code Expand
import bisect, heapq, sys, math, copy, itertools, decimal
from collections import defaultdict, deque
sys.setrecursionlimit(10**7)
def INT(): return int(input())
def MI(d=0): return map(lambda x:int(x)+d, input().split())
def MS(): return map(str, input().split())
def LI(d=0): return list(map(lambda x:int(x)+d, input().split()))
def LS(): return list(map(str, input().split()))
def pr_line(itr): print(*itr, sep='\n')
def pr_mtx(matrix): [print(*row) for row in matrix]
dij = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dij2 = [[1, 0], [0, 1], [-1, 0], [0, -1], [1, 1], [1, -1], [-1, 1], [-1, -1]]
INF = float('inf')
X = INT()
ans = []
for p in range(1, 10**7+1000):
if p*p > X**2:
break
A = 4*p*p - 4*X + 1
if A < 0:
continue
rA = int(A**0.5)
if A == rA**2:
S = -1 + rA
T = -1 - rA
if S%2 == 0: ans.append(S//2)
if T%2 == 0: ans.append(T//2)
elif A == (rA+1)**2:
S = -1 + (rA+1)
T = -1 - (rA+1)
if S%2 == 0: ans.append(S//2)
if T%2 == 0: ans.append(T//2)
print(*sorted(ans))
Submission Info
| Submission Time | |
|---|---|
| Task | G - sqrt(n²+n+X) |
| User | BenKenobi |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 0 |
| Code Size | 1124 Byte |
| Status | WA |
| Exec Time | 930 ms |
| Memory | 96960 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 575 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 01_handmade_10.txt, 01_handmade_11.txt, 01_handmade_12.txt, 01_handmade_13.txt, 01_handmade_14.txt, 01_handmade_15.txt, 01_handmade_16.txt, 01_handmade_17.txt, 01_handmade_18.txt, 01_handmade_19.txt, 01_handmade_20.txt, 01_handmade_21.txt, 01_handmade_22.txt, 01_handmade_23.txt, 01_handmade_24.txt, 01_handmade_25.txt, 01_handmade_26.txt, 01_handmade_27.txt, 01_handmade_28.txt, 01_handmade_29.txt, 01_handmade_30.txt, 01_handmade_31.txt, 01_handmade_32.txt, 01_handmade_33.txt, 01_handmade_34.txt, 01_handmade_35.txt, 01_handmade_36.txt, 01_handmade_37.txt, 01_handmade_38.txt, 01_handmade_39.txt, 01_handmade_40.txt, 01_handmade_41.txt, 01_handmade_42.txt, 01_handmade_43.txt, 01_handmade_44.txt, 01_handmade_45.txt, 01_handmade_46.txt, 01_handmade_47.txt, 01_handmade_48.txt, 01_handmade_49.txt, 02_radom_00.txt, 02_radom_01.txt, 02_radom_02.txt, 02_radom_03.txt, 02_radom_04.txt, 02_radom_05.txt, 02_radom_06.txt, 02_radom_07.txt, 02_radom_08.txt, 02_radom_09.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | WA | 228 ms | 95220 KiB |
| 00_sample_01.txt | WA | 273 ms | 95976 KiB |
| 00_sample_02.txt | WA | 715 ms | 95708 KiB |
| 01_handmade_00.txt | WA | 265 ms | 94912 KiB |
| 01_handmade_01.txt | WA | 394 ms | 95020 KiB |
| 01_handmade_02.txt | WA | 296 ms | 95056 KiB |
| 01_handmade_03.txt | WA | 258 ms | 95076 KiB |
| 01_handmade_04.txt | WA | 234 ms | 95268 KiB |
| 01_handmade_05.txt | WA | 202 ms | 95012 KiB |
| 01_handmade_06.txt | WA | 168 ms | 95024 KiB |
| 01_handmade_07.txt | WA | 268 ms | 95020 KiB |
| 01_handmade_08.txt | WA | 183 ms | 95028 KiB |
| 01_handmade_09.txt | WA | 242 ms | 94724 KiB |
| 01_handmade_10.txt | WA | 274 ms | 94844 KiB |
| 01_handmade_11.txt | WA | 290 ms | 94848 KiB |
| 01_handmade_12.txt | WA | 361 ms | 95264 KiB |
| 01_handmade_13.txt | WA | 271 ms | 95052 KiB |
| 01_handmade_14.txt | WA | 295 ms | 95116 KiB |
| 01_handmade_15.txt | WA | 313 ms | 95008 KiB |
| 01_handmade_16.txt | WA | 345 ms | 95068 KiB |
| 01_handmade_17.txt | WA | 280 ms | 95068 KiB |
| 01_handmade_18.txt | WA | 301 ms | 94924 KiB |
| 01_handmade_19.txt | WA | 270 ms | 95264 KiB |
| 01_handmade_20.txt | WA | 279 ms | 95168 KiB |
| 01_handmade_21.txt | WA | 726 ms | 96544 KiB |
| 01_handmade_22.txt | WA | 655 ms | 96728 KiB |
| 01_handmade_23.txt | WA | 639 ms | 96712 KiB |
| 01_handmade_24.txt | WA | 779 ms | 96792 KiB |
| 01_handmade_25.txt | WA | 806 ms | 96840 KiB |
| 01_handmade_26.txt | WA | 752 ms | 96672 KiB |
| 01_handmade_27.txt | WA | 205 ms | 95832 KiB |
| 01_handmade_28.txt | WA | 795 ms | 96880 KiB |
| 01_handmade_29.txt | WA | 354 ms | 95864 KiB |
| 01_handmade_30.txt | WA | 722 ms | 96752 KiB |
| 01_handmade_31.txt | WA | 354 ms | 95808 KiB |
| 01_handmade_32.txt | WA | 802 ms | 96372 KiB |
| 01_handmade_33.txt | WA | 340 ms | 95792 KiB |
| 01_handmade_34.txt | WA | 733 ms | 96172 KiB |
| 01_handmade_35.txt | WA | 274 ms | 95732 KiB |
| 01_handmade_36.txt | WA | 775 ms | 96960 KiB |
| 01_handmade_37.txt | WA | 432 ms | 95936 KiB |
| 01_handmade_38.txt | WA | 930 ms | 96072 KiB |
| 01_handmade_39.txt | WA | 406 ms | 95788 KiB |
| 01_handmade_40.txt | WA | 767 ms | 95892 KiB |
| 01_handmade_41.txt | WA | 210 ms | 95764 KiB |
| 01_handmade_42.txt | WA | 528 ms | 95692 KiB |
| 01_handmade_43.txt | WA | 213 ms | 95852 KiB |
| 01_handmade_44.txt | WA | 526 ms | 96236 KiB |
| 01_handmade_45.txt | WA | 202 ms | 95884 KiB |
| 01_handmade_46.txt | WA | 525 ms | 96036 KiB |
| 01_handmade_47.txt | WA | 203 ms | 95428 KiB |
| 01_handmade_48.txt | WA | 526 ms | 95852 KiB |
| 01_handmade_49.txt | WA | 259 ms | 96832 KiB |
| 02_radom_00.txt | WA | 250 ms | 96052 KiB |
| 02_radom_01.txt | WA | 531 ms | 96748 KiB |
| 02_radom_02.txt | WA | 526 ms | 96180 KiB |
| 02_radom_03.txt | WA | 536 ms | 96696 KiB |
| 02_radom_04.txt | WA | 527 ms | 96528 KiB |
| 02_radom_05.txt | WA | 292 ms | 95904 KiB |
| 02_radom_06.txt | WA | 319 ms | 96040 KiB |
| 02_radom_07.txt | WA | 524 ms | 96016 KiB |
| 02_radom_08.txt | WA | 287 ms | 95692 KiB |
| 02_radom_09.txt | WA | 245 ms | 95692 KiB |