結果

問題 No.1593 Perfect Distance
ユーザー ygd.ygd.
提出日時 2021-07-31 16:53:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 236 bytes
コンパイル時間 360 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 76,160 KB
最終ジャッジ日時 2023-10-14 15:00:55
合計ジャッジ時間 3,788 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,212 KB
testcase_01 AC 92 ms
71,176 KB
testcase_02 AC 83 ms
71,372 KB
testcase_03 AC 77 ms
71,540 KB
testcase_04 AC 78 ms
71,224 KB
testcase_05 AC 77 ms
71,300 KB
testcase_06 AC 77 ms
71,220 KB
testcase_07 AC 78 ms
71,400 KB
testcase_08 AC 79 ms
71,180 KB
testcase_09 AC 85 ms
75,736 KB
testcase_10 AC 83 ms
75,736 KB
testcase_11 AC 83 ms
75,780 KB
testcase_12 AC 85 ms
75,960 KB
testcase_13 AC 82 ms
76,028 KB
testcase_14 AC 84 ms
75,744 KB
testcase_15 AC 84 ms
76,028 KB
testcase_16 AC 83 ms
76,160 KB
testcase_17 AC 79 ms
71,244 KB
testcase_18 AC 77 ms
71,616 KB
testcase_19 AC 79 ms
71,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def main():
    N = int(input())
    ans = 0
    for x in range(1,N):
        y2 = N**2 - x**2
        y = int(math.sqrt(y2))
        if y**2 == y2:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()
0