結果

問題 No.1593 Perfect Distance
コンテスト
ユーザー Fullmoon85072
提出日時 2021-11-28 14:53:54
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 276 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,447 ms
コンパイル使用メモリ 85,372 KB
実行使用メモリ 144,956 KB
最終ジャッジ日時 2026-03-22 06:33:20
合計ジャッジ時間 26,852 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 TLE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math

N = int(input())

twoN = math.pow(N, 2)

count = 0
for x in range(N):
    for y in range(N):
        dx = math.pow(x, 2)
        dy = math.pow(y, 2)
        if dx + dy == twoN:
            count += 1
        elif dx + dy > twoN:
            continue

print(count)
0