結果

問題 No.1593 Perfect Distance
ユーザー IgrmiIgrmi
提出日時 2021-07-09 21:36:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 2,000 ms
コード長 146 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 107,188 KB
最終ジャッジ日時 2023-09-14 08:01:01
合計ジャッジ時間 2,803 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,584 KB
testcase_01 AC 68 ms
71,644 KB
testcase_02 AC 69 ms
71,156 KB
testcase_03 AC 67 ms
71,296 KB
testcase_04 AC 70 ms
71,476 KB
testcase_05 AC 70 ms
71,444 KB
testcase_06 AC 70 ms
71,160 KB
testcase_07 AC 70 ms
71,324 KB
testcase_08 AC 71 ms
71,344 KB
testcase_09 AC 75 ms
76,364 KB
testcase_10 AC 77 ms
78,920 KB
testcase_11 AC 81 ms
82,352 KB
testcase_12 AC 86 ms
87,580 KB
testcase_13 AC 87 ms
87,540 KB
testcase_14 AC 91 ms
90,448 KB
testcase_15 AC 103 ms
96,516 KB
testcase_16 AC 111 ms
107,188 KB
testcase_17 AC 68 ms
71,584 KB
testcase_18 AC 69 ms
71,440 KB
testcase_19 AC 67 ms
71,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = set()
Ans = 0
for i in range(1, N + 1): S.add(i * i)
for i in range(1, N + 1):
    if N * N - i * i in S: Ans += 1
print(Ans)
0