結果

問題 No.1593 Perfect Distance
ユーザー tktk
提出日時 2021-07-10 00:46:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 76,596 KB
最終ジャッジ日時 2023-09-14 12:09:13
合計ジャッジ時間 2,864 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,068 KB
testcase_01 AC 74 ms
71,392 KB
testcase_02 AC 71 ms
71,188 KB
testcase_03 AC 72 ms
71,164 KB
testcase_04 AC 72 ms
71,272 KB
testcase_05 AC 71 ms
71,400 KB
testcase_06 AC 70 ms
71,368 KB
testcase_07 AC 70 ms
71,200 KB
testcase_08 AC 73 ms
71,184 KB
testcase_09 AC 79 ms
76,448 KB
testcase_10 AC 77 ms
76,196 KB
testcase_11 AC 80 ms
76,292 KB
testcase_12 AC 83 ms
76,596 KB
testcase_13 AC 82 ms
76,416 KB
testcase_14 AC 84 ms
76,232 KB
testcase_15 AC 83 ms
76,440 KB
testcase_16 AC 81 ms
76,064 KB
testcase_17 AC 72 ms
71,372 KB
testcase_18 AC 71 ms
71,124 KB
testcase_19 AC 70 ms
71,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
cnt = 0
import math
for i in range(1,N):
    l = (N+i)*(N-i)
    p = math.sqrt(l)
    t = math.ceil(p)
    m = math.floor(p)
    if p == t and p > 0:
        cnt += 1
        #print(p,t,m)
print(cnt)
0