結果

問題 No.1593 Perfect Distance
ユーザー tcltktcltk
提出日時 2021-11-19 23:55:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 232 ms / 2,000 ms
コード長 497 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 92,788 KB
最終ジャッジ日時 2023-08-30 11:35:18
合計ジャッジ時間 6,905 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 224 ms
89,548 KB
testcase_01 AC 220 ms
89,412 KB
testcase_02 AC 222 ms
89,528 KB
testcase_03 AC 223 ms
89,348 KB
testcase_04 AC 223 ms
89,676 KB
testcase_05 AC 224 ms
89,308 KB
testcase_06 AC 218 ms
89,556 KB
testcase_07 AC 220 ms
89,536 KB
testcase_08 AC 225 ms
89,408 KB
testcase_09 AC 232 ms
92,788 KB
testcase_10 AC 222 ms
90,396 KB
testcase_11 AC 228 ms
92,756 KB
testcase_12 AC 230 ms
92,500 KB
testcase_13 AC 230 ms
92,612 KB
testcase_14 AC 230 ms
92,724 KB
testcase_15 AC 232 ms
92,528 KB
testcase_16 AC 220 ms
90,440 KB
testcase_17 AC 218 ms
89,324 KB
testcase_18 AC 216 ms
89,700 KB
testcase_19 AC 219 ms
89,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """5
# """
# sys.stdin = io.StringIO(_INPUT)

INF = 10**10


N = int(input())

n = 0
x = 1
while True:
    if x*x + 1 > N*N:
        break
    y = int(math.sqrt(N*N - x*x + 0.001))
    if x*x + y*y == N*N:
        n += 1
    x += 1
print(n)
0