結果

問題 No.1593 Perfect Distance
ユーザー tassei903tassei903
提出日時 2021-07-09 21:30:00
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 530 ms
使用メモリ 81,808 KB
最終ジャッジ日時 2023-02-01 22:14:00
合計ジャッジ時間 3,352 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 83 ms
75,692 KB
testcase_01 AC 83 ms
76,268 KB
testcase_02 AC 83 ms
76,016 KB
testcase_03 AC 85 ms
76,080 KB
testcase_04 AC 84 ms
76,184 KB
testcase_05 AC 85 ms
76,172 KB
testcase_06 AC 85 ms
76,088 KB
testcase_07 AC 93 ms
81,460 KB
testcase_08 AC 96 ms
81,488 KB
testcase_09 AC 98 ms
81,540 KB
testcase_10 AC 105 ms
81,416 KB
testcase_11 AC 107 ms
81,284 KB
testcase_12 AC 109 ms
81,404 KB
testcase_13 AC 111 ms
81,312 KB
testcase_14 AC 112 ms
81,524 KB
testcase_15 AC 115 ms
81,356 KB
testcase_16 AC 121 ms
81,808 KB
testcase_17 AC 84 ms
75,992 KB
testcase_18 AC 84 ms
75,868 KB
testcase_19 AC 84 ms
76,088 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