暴力 Codeforces Round #183 (Div. 2) A. Pythagorean Theorem II
2024-09-25 10:29:02
/*
暴力: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 ;
}
最新文章
- jq制作圣诞主题页面
- Heartbeat使用梳理
- 优雅的处理Android数据库升级的问题
- javascript的事件监听与捕获和冒泡
- BZOJ2216 : [Poi2011]Lightning Conductor
- HIbernate java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys()Z
- Linux下搭建Oracle11g RAC(8)----创建ASM磁盘组
- 妙用transform
- 移植 wifi模块
- Ueditor1.3.6 setContent的一个bug
- 通过java程序调用ant build.xml配置文件中指定的target
- Tesseract-OCR的使用记录
- Nginx子域名配置
- ADO.NET分享
- webstorm&#39;s interpreter
- Live555实战之交叉编译live555共享库
- [转]地图投影的N种姿势
- FineReport基本使用
- 【Oracle】等待事件详细内容
- case when 多个条件 以及case when 权重排序
热门文章
- elasticsarch5.4集群安装
- 纠结的链接——ln、ln -s、fs.symlink、require
- discuz的php7版本号
- CxImage的编译及简单使用举例
- react-router-redux
- Opengl ES 1.x NDK实例开发之七:旋转的纹理立方体
- Android之——AIDL深入
- 【bzoj2152】【聪聪可可】【点分治】
- 嵌入式开发之davinci--- 8148 中dsp在dsp_drv.c中的processdata()加算法出现下边缘条纹问题
- Hibernate 之 二级缓存