結果

問題 No.1593 Perfect Distance
ユーザー tamatotamato
提出日時 2021-07-09 21:22:54
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 275 ms
使用メモリ 81,560 KB
最終ジャッジ日時 2023-02-01 21:42:33
合計ジャッジ時間 3,412 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 86 ms
76,012 KB
testcase_01 AC 86 ms
75,872 KB
testcase_02 AC 87 ms
76,064 KB
testcase_03 AC 87 ms
76,248 KB
testcase_04 AC 85 ms
76,252 KB
testcase_05 AC 87 ms
76,040 KB
testcase_06 AC 86 ms
76,152 KB
testcase_07 AC 89 ms
76,196 KB
testcase_08 AC 96 ms
81,064 KB
testcase_09 AC 94 ms
80,972 KB
testcase_10 AC 94 ms
81,284 KB
testcase_11 AC 95 ms
81,172 KB
testcase_12 AC 94 ms
81,268 KB
testcase_13 AC 95 ms
81,304 KB
testcase_14 AC 95 ms
81,196 KB
testcase_15 AC 98 ms
81,420 KB
testcase_16 AC 99 ms
81,560 KB
testcase_17 AC 86 ms
76,160 KB
testcase_18 AC 85 ms
76,100 KB
testcase_19 AC 86 ms
76,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    from math import floor, sqrt
    input = sys.stdin.readline

    N = int(input())
    ans = 0
    for x in range(1, N):
        y = floor(sqrt(N**2 - x**2))
        for yy in range(y-1, y+2):
            if x**2 + yy**2 == N**2:
                ans += 1
    print(ans)


if __name__ == '__main__':
    main()
0