結果

問題 No.1593 Perfect Distance
ユーザー Ain48803949Ain48803949
提出日時 2021-07-09 21:57:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 803 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 10,364 KB
最終ジャッジ日時 2023-09-14 08:55:33
合計ジャッジ時間 2,326 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,272 KB
testcase_01 AC 33 ms
10,348 KB
testcase_02 AC 32 ms
10,192 KB
testcase_03 AC 32 ms
10,152 KB
testcase_04 AC 33 ms
10,132 KB
testcase_05 AC 31 ms
10,160 KB
testcase_06 AC 33 ms
10,364 KB
testcase_07 AC 32 ms
10,268 KB
testcase_08 AC 32 ms
10,332 KB
testcase_09 AC 34 ms
10,196 KB
testcase_10 AC 41 ms
10,232 KB
testcase_11 AC 49 ms
10,156 KB
testcase_12 AC 61 ms
10,224 KB
testcase_13 AC 64 ms
10,188 KB
testcase_14 AC 66 ms
10,232 KB
testcase_15 AC 85 ms
10,252 KB
testcase_16 AC 113 ms
10,164 KB
testcase_17 AC 31 ms
10,256 KB
testcase_18 AC 32 ms
10,208 KB
testcase_19 AC 31 ms
10,208 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect,collections,copy,heapq,itertools,math,string,sys,queue,time,random
input = lambda: sys.stdin.readline().rstrip()
def I(): return input()
def IS(): return input().split()
def II(): return int(input())
def IIS(): return map(int,input().split())
def LIIS(): return list(map(int,input().split()))
def Base_n_to_10(X,n):
    out = 0
    for i in range(1,len(str(X))+1):
        out += int(X[-i])*(n**(i-1))
    return out#int out
def Base_10_to_n(X, n):
    if (X//n):
        return Base_10_to_n(X//n, n)+str(X%n)
    return str(X%n)
INF=10**18
MOD=10**9+7
sys.setrecursionlimit(10**8)
##############################################################################
n=II()
ans=0
for x in range(1,n):
    #print((n**2-x**2)**0.5)
    if ((n**2-x**2)**0.5).is_integer():
        ans+=1
print(ans)
0