結果

問題 No.1593 Perfect Distance
ユーザー titiatitia
提出日時 2021-07-09 21:26:27
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 144 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 8,276 KB
最終ジャッジ日時 2023-09-14 07:42:23
合計ジャッジ時間 1,696 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
8,076 KB
testcase_01 AC 13 ms
8,192 KB
testcase_02 AC 13 ms
8,192 KB
testcase_03 AC 13 ms
8,232 KB
testcase_04 AC 13 ms
8,060 KB
testcase_05 AC 13 ms
8,100 KB
testcase_06 AC 14 ms
8,264 KB
testcase_07 AC 13 ms
8,248 KB
testcase_08 AC 13 ms
8,128 KB
testcase_09 AC 17 ms
8,104 KB
testcase_10 AC 26 ms
8,236 KB
testcase_11 AC 33 ms
8,128 KB
testcase_12 AC 51 ms
8,072 KB
testcase_13 AC 52 ms
8,088 KB
testcase_14 AC 56 ms
8,128 KB
testcase_15 AC 78 ms
8,232 KB
testcase_16 AC 111 ms
8,244 KB
testcase_17 AC 12 ms
8,088 KB
testcase_18 AC 13 ms
8,276 KB
testcase_19 AC 13 ms
8,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
from math import sqrt

ANS=0
for x in range(1,N+1):
    y=sqrt(N*N-x*x)

    if int(y)==y:
        ANS+=1
print(ANS-1)
    
    
0