結果
問題 | No.800 四平方定理 |
ユーザー |
|
提出日時 | 2020-09-16 20:20:02 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 359 ms |
コンパイル使用メモリ | 82,424 KB |
実行使用メモリ | 459,320 KB |
最終ジャッジ日時 | 2024-06-22 03:33:17 |
合計ジャッジ時間 | 34,640 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 TLE * 8 |
ソースコード
import sys input = sys.stdin.readline def MI(): return map(int, input().split()) n,d=MI() from collections import Counter wz,xy=[],[] for i in range(1,n+1): for j in range(1,n+1): wz.append(i**2-j**2+d) wz=Counter(wz) for i in range(1,n+1): for j in range(1,n+1): xy.append(i**2+j**2) ans=0 for i in xy: ans+=wz[i] print(ans)