結果

問題 No.1593 Perfect Distance
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2023-06-29 12:31:58
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 286 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 80,528 KB
最終ジャッジ日時 2023-09-20 07:57:26
合計ジャッジ時間 9,150 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,496 KB
testcase_01 AC 76 ms
71,132 KB
testcase_02 AC 72 ms
71,260 KB
testcase_03 AC 71 ms
71,356 KB
testcase_04 AC 72 ms
71,368 KB
testcase_05 AC 70 ms
71,312 KB
testcase_06 AC 76 ms
75,916 KB
testcase_07 AC 77 ms
75,940 KB
testcase_08 AC 85 ms
76,416 KB
testcase_09 AC 195 ms
76,388 KB
testcase_10 AC 1,112 ms
76,276 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

ans = 0
for x in range(n):
    if 2 * x**2 > n**2:
        break
    if 2 * x**2 == n**2:
        ans += 1
        continue
    for y in range(x + 1, n):
        if x**2 + y**2 == n**2:
            ans += 2
        if x**2 + y**2 > n**2:
            break

print(ans)
0