题目传送门

 /*
暴力:O (n^2)
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
using namespace std; const int MAXN = 1e4 + ;
const int INF = 0x3f3f3f3f; int main(void) //Codeforces Round #183 (Div. 2) A. Pythagorean Theorem II
{
int n;
while (scanf ("%d", &n) == )
{
int ans = ;
for (int i=; i<=n; ++i)
{
for (int j=i; j<=n; ++j)
{
if (i * i + j * j > n * n) break;
int c = sqrt (i * i + j * j);
if (c <= n && c * c == i * i + j * j) ans++;
}
} printf ("%d\n", ans);
} return ;
}

最新文章

  1. jq制作圣诞主题页面
  2. Heartbeat使用梳理
  3. 优雅的处理Android数据库升级的问题
  4. javascript的事件监听与捕获和冒泡
  5. BZOJ2216 : [Poi2011]Lightning Conductor
  6. HIbernate java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Z
  7. Linux下搭建Oracle11g RAC(8)----创建ASM磁盘组
  8. 妙用transform
  9. 移植 wifi模块
  10. Ueditor1.3.6 setContent的一个bug
  11. 通过java程序调用ant build.xml配置文件中指定的target
  12. Tesseract-OCR的使用记录
  13. Nginx子域名配置
  14. ADO.NET分享
  15. webstorm&#39;s interpreter
  16. Live555实战之交叉编译live555共享库
  17. [转]地图投影的N种姿势
  18. FineReport基本使用
  19. 【Oracle】等待事件详细内容
  20. case when 多个条件 以及case when 权重排序

热门文章

  1. elasticsarch5.4集群安装
  2. 纠结的链接——ln、ln -s、fs.symlink、require
  3. discuz的php7版本号
  4. CxImage的编译及简单使用举例
  5. react-router-redux
  6. Opengl ES 1.x NDK实例开发之七:旋转的纹理立方体
  7. Android之——AIDL深入
  8. 【bzoj2152】【聪聪可可】【点分治】
  9. 嵌入式开发之davinci--- 8148 中dsp在dsp_drv.c中的processdata()加算法出现下边缘条纹问题
  10. Hibernate 之 二级缓存