题意:

给出一个x,求有多少个矩阵中满足存在x个不同的正方形。

思路:

(数学渣+推理渣)

#include<bits/stdc++.h>
using namespace std;
typedef long long LL; const LL N=1e6+10;
struct asd{
LL a,b;
};
asd ans[N];
int num; bool cmp(asd x,asd y)
{
return x.a<y.a;
} int main()
{
LL x;
LL aa,bb,cc;
scanf("%lld",&x);
num=0;
for(LL i=1;i<2*N;i++)
{
aa=6*x+i*i*i-i;
bb=3*i*(i+1);
if(aa%bb==0)
{
cc=aa/bb;
if(i>cc)
break;
ans[num].a=i;
ans[num++].b=cc;
if(i!=cc)
{
ans[num].a=cc;
ans[num++].b=i;
}
else
break;
}
}
sort(ans,ans+num,cmp);
printf("%d\n",num);
for(int i=0;i<num;i++)
printf("%lld %lld\n",ans[i].a,ans[i].b);
return 0;
}

最新文章

  1. Blog List
  2. C# final project
  3. Hibernate —— Hibernate 配置文件
  4. Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property &#39;xxx&#39;: no matching editors or conversion strategy found
  5. Swift Tour 随笔总结 (1)
  6. Loadrunner性能指标分析
  7. php mysqli多个查询的例子
  8. maven解决.lastUpdated maven无法下载jar
  9. QT学习 之 三维饼图绘制
  10. grep命令參数及使用方法
  11. 基于vue的多引擎搜索及关键字提示
  12. iOS UIAlertView 文字对其方式 文字大小 设置方法
  13. javascript DOM document对象
  14. PGM:图模型学习概述
  15. 面向对象的JavaScript-小结
  16. .net core部署在iis上
  17. Filter Authentication 登录认证
  18. 高斯消元处理无解|多解情况 poj1830
  19. The history of programming languages.(transshipment) + Personal understanding and prediction
  20. 京东某商品页面的简单爬取 --Pyhon网络爬虫与信息获取

热门文章

  1. ubuntu手机识别
  2. Android-可随意拖动的View
  3. 我在开发第一个Swift App过程中学到的四件事
  4. 配置hadoop用户SSH无密码登陆 的2种方式 落脚点是 可以ssh免密进入的主机名写入动作发出主机的 known_hosts,而被无密进入主机的authorized_keys文件 免密登录
  5. cocos2d-js v3新特性
  6. for(String s:list)的运行
  7. HDU3480 Division —— 斜率优化DP
  8. Codeforces Round #394 (Div. 2) D. Dasha and Very Difficult Problem —— 贪心
  9. 阿里云数据库产品HybridDB简介——OLAP数据库,支持行列混合存储,基于数据库Greenplum的开源版本,并且吸收PostgreSQL精髓
  10. hdu-5742 It&#39;s All In The Mind(数学)