結果

問題 No.1593 Perfect Distance
ユーザー tassei903tassei903
提出日時 2021-07-09 21:30:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 329 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 77,196 KB
最終ジャッジ日時 2023-09-14 07:51:38
合計ジャッジ時間 2,854 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,500 KB
testcase_01 AC 69 ms
71,964 KB
testcase_02 AC 68 ms
72,028 KB
testcase_03 AC 69 ms
71,920 KB
testcase_04 AC 69 ms
71,984 KB
testcase_05 AC 69 ms
71,792 KB
testcase_06 AC 72 ms
71,792 KB
testcase_07 AC 77 ms
77,016 KB
testcase_08 AC 80 ms
77,172 KB
testcase_09 AC 81 ms
77,196 KB
testcase_10 AC 86 ms
76,860 KB
testcase_11 AC 89 ms
76,956 KB
testcase_12 AC 90 ms
77,008 KB
testcase_13 AC 91 ms
77,144 KB
testcase_14 AC 91 ms
77,020 KB
testcase_15 AC 97 ms
77,056 KB
testcase_16 AC 104 ms
77,052 KB
testcase_17 AC 71 ms
71,792 KB
testcase_18 AC 69 ms
71,656 KB
testcase_19 AC 70 ms
71,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
sys.setrecursionlimit(10**7)
yes = lambda :print("yes");Yes = lambda :print("Yes")
no = lambda :print("no");No = lambda :print("No")
#######################################################################
n = ni()
ans = 0
for i in range(1,n):
    y1 = int((n**2-i**2)**0.5)
    for j in range(-2,3):
        if y1+j<=0:
            continue
        if (y1+j)*(y1+j)+i*i==n*n:
            ans+=1
print(ans)
0