結果
問題 |
No.800 四平方定理
|
ユーザー |
![]() |
提出日時 | 2020-07-16 21:56:58 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 410 bytes |
コンパイル時間 | 173 ms |
コンパイル使用メモリ | 82,840 KB |
実行使用メモリ | 127,384 KB |
最終ジャッジ日時 | 2024-11-25 08:53:39 |
合計ジャッジ時間 | 5,743 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 8 |
ソースコード
mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N, D = map(int, input().split()) cnt = [0] * 8000001 for w in range(1, N+1): for z in range(1, N+1): cnt[w*w - z*z] += 1 ans = 0 for x in range(1, N+1): for y in range(1, N+1): ans += cnt[x*x + y*y - D] print(ans) if __name__ == '__main__': main()