提出 #72180082


ソースコード 拡げる

import math
n=int(input())
a=[0]*10001010
ans=[]
for i in range(1,math.ceil(n**0.55)):
    for j in range(i+1,math.ceil(n**0.55)):
        if i*i+j*j>10000000: break
        a[i*i+j*j]+=1
for i in range(1,n+1):
    if a[i]==1: ans.append(i)
print(len(ans))
print(*ans)

提出情報

提出日時
問題 C - 2026
ユーザ Hakuaa_2
言語 Python (PyPy 3.11-v7.3.20)
得点 300
コード長 279 Byte
結果 AC
実行時間 608 ms
メモリ 273812 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 18
セット名 テストケース
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_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_corner_00.txt, 02_corner_01.txt, 02_corner_02.txt, 02_corner_03.txt, 02_corner_04.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 74 ms 158112 KiB
00_sample_01.txt AC 74 ms 157916 KiB
00_sample_02.txt AC 73 ms 158088 KiB
01_random_00.txt AC 350 ms 227720 KiB
01_random_01.txt AC 546 ms 269968 KiB
01_random_02.txt AC 348 ms 227564 KiB
01_random_03.txt AC 568 ms 271332 KiB
01_random_04.txt AC 276 ms 212300 KiB
01_random_05.txt AC 384 ms 234076 KiB
01_random_06.txt AC 308 ms 219504 KiB
01_random_07.txt AC 293 ms 215852 KiB
01_random_08.txt AC 368 ms 232976 KiB
01_random_09.txt AC 587 ms 272892 KiB
02_corner_00.txt AC 81 ms 165524 KiB
02_corner_01.txt AC 597 ms 273768 KiB
02_corner_02.txt AC 608 ms 273480 KiB
02_corner_03.txt AC 603 ms 273812 KiB
02_corner_04.txt AC 599 ms 273764 KiB