結果

問題 No.1593 Perfect Distance
ユーザー wesoweeenwesoweeen
提出日時 2021-07-11 14:04:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 477 bytes
コンパイル時間 113 ms
コンパイル使用メモリ 10,988 KB
実行使用メモリ 12,848 KB
最終ジャッジ日時 2023-09-14 20:09:51
合計ジャッジ時間 4,182 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
12,200 KB
testcase_01 AC 16 ms
7,824 KB
testcase_02 AC 16 ms
7,864 KB
testcase_03 AC 16 ms
7,800 KB
testcase_04 AC 16 ms
7,828 KB
testcase_05 AC 16 ms
7,796 KB
testcase_06 AC 16 ms
7,816 KB
testcase_07 AC 32 ms
7,820 KB
testcase_08 AC 236 ms
7,864 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    l = []
    x_list = []
    y_list = []
    num = N ** 2
    for n in range(1, num):
        if n ** 2 <= num:
            x_list.append(n ** 2)
    for m in range(1, num):
        if m ** 2 <= num:
            y_list.append(m ** 2)
    for i in range(len(x_list)):
        for j in range(len(y_list)):
            if x_list[i] + y_list[j] == num:
                l.append(x_list[i])
    print(len(l))


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