結果
問題 | No.1593 Perfect Distance |
ユーザー | OohMajestic! |
提出日時 | 2021-07-10 08:55:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 89 ms / 2,000 ms |
コード長 | 433 bytes |
コンパイル時間 | 286 ms |
コンパイル使用メモリ | 87,088 KB |
実行使用メモリ | 76,576 KB |
最終ジャッジ日時 | 2023-09-14 18:40:55 |
合計ジャッジ時間 | 2,816 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,136 KB |
testcase_01 | AC | 72 ms
71,180 KB |
testcase_02 | AC | 71 ms
71,616 KB |
testcase_03 | AC | 72 ms
71,004 KB |
testcase_04 | AC | 73 ms
71,372 KB |
testcase_05 | AC | 73 ms
71,308 KB |
testcase_06 | AC | 71 ms
71,352 KB |
testcase_07 | AC | 72 ms
71,548 KB |
testcase_08 | AC | 71 ms
71,348 KB |
testcase_09 | AC | 81 ms
76,420 KB |
testcase_10 | AC | 77 ms
76,340 KB |
testcase_11 | AC | 83 ms
76,576 KB |
testcase_12 | AC | 83 ms
76,552 KB |
testcase_13 | AC | 84 ms
76,456 KB |
testcase_14 | AC | 86 ms
76,352 KB |
testcase_15 | AC | 89 ms
76,464 KB |
testcase_16 | AC | 88 ms
76,112 KB |
testcase_17 | AC | 71 ms
71,400 KB |
testcase_18 | AC | 72 ms
71,396 KB |
testcase_19 | AC | 70 ms
71,244 KB |
ソースコード
import math N = int(input()) radius = N ** 2 primal = [0, 1, 129, 4, 132, 9, 137, 16, 144, 17, 145, 25, 153, 33, 161, 36, 164, 169, 41, 49, 177, 185, 57, 64, 193, 65, 196, 68, 73, 201, 81, 209, 217, 89, 225, 97, 100, 228, 249, 105, 233, 113, 241, 121] count = 0 for i in range(1, N): target = radius - i ** 2 if ((target % 256) in primal): if (math.sqrt(target).is_integer()): count += 1 print(count)