結果
問題 | No.800 四平方定理 |
ユーザー |
![]() |
提出日時 | 2020-08-17 23:33:19 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,616 ms / 2,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 275 ms |
コンパイル使用メモリ | 81,872 KB |
実行使用メモリ | 203,596 KB |
最終ジャッジ日時 | 2024-10-11 11:31:28 |
合計ジャッジ時間 | 21,783 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
# coding: utf-8# Your code here!N,D=map(int,input().split())xy={}for i in range(1,N+1):for j in range(1,N+1):temp=(i**2+j**2)if temp in xy:xy[temp]+=1else:xy[temp]=1ans=0for i in range(1,N+1):for j in range(1,N+1):temp=(i**2-j**2)if D-temp in xy:ans+=xy[D-temp]print(ans)