結果

問題 No.800 四平方定理
ユーザー ntk-ta01ntk-ta01
提出日時 2020-08-01 15:23:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 201,652 KB
最終ジャッジ日時 2023-09-22 10:50:28
合計ジャッジ時間 8,822 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
200,636 KB
testcase_01 AC 154 ms
201,072 KB
testcase_02 AC 149 ms
201,544 KB
testcase_03 AC 152 ms
201,332 KB
testcase_04 AC 151 ms
201,216 KB
testcase_05 AC 152 ms
201,508 KB
testcase_06 AC 150 ms
201,408 KB
testcase_07 AC 147 ms
201,404 KB
testcase_08 AC 149 ms
201,472 KB
testcase_09 AC 150 ms
201,076 KB
testcase_10 AC 204 ms
201,464 KB
testcase_11 AC 220 ms
201,516 KB
testcase_12 AC 217 ms
201,328 KB
testcase_13 AC 218 ms
201,376 KB
testcase_14 AC 218 ms
201,580 KB
testcase_15 AC 218 ms
201,564 KB
testcase_16 AC 220 ms
201,356 KB
testcase_17 AC 224 ms
201,432 KB
testcase_18 AC 218 ms
201,332 KB
testcase_19 AC 221 ms
201,248 KB
testcase_20 AC 143 ms
200,476 KB
testcase_21 AC 144 ms
200,424 KB
testcase_22 AC 224 ms
201,432 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 142 ms
200,440 KB
testcase_27 AC 144 ms
200,384 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

ADD = 4*10**6


def main():
    N, D = (int(i) for i in input().split())

    cA = [0]*(2*ADD)
    for x in range(1, N+1):
        for y in range(1, N+1):
            cA[D - x**2 - y**2 + ADD] += 1

    cB = [0]*(2*ADD)
    for z in range(1, N+1):
        for w in range(1, N+1):
            cB[z**2 - w**2 + ADD] += 1

    ans = 0
    for a, b in zip(cA, cB):
        ans += a*b
    print(ans)


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