SRM 582 Div II Level One: SemiPerfectSquare
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12580
比较简单,代码如下:
#include <iostream>
#include <string>
#include <cmath> using namespace std; class SemiPerfectSquare
{
public:
string check(int N);
}; string SemiPerfectSquare::check(int N)
{
int sq = (int)sqrt((double)N); for (int i = 0; i <= sq; i++) {
for (int j = 0; j < i; j++) {
if (j * i * i == N) {
return "Yes";
}
}
} return "No";
}
SRM 582 Div II Level One: SemiPerfectSquare的更多相关文章
- SRM 582 Div II Level Three: ColorTheCells, Brute Force 算法
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12581 Burte Force 算法,求解了所有了情况,注意 ...
- SRM 582 Div II Level Two SpaceWarDiv2
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12556 #include <iostream> # ...
- SRM 583 Div II Level One:SwappingDigits
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12609 #include <iostream> # ...
- SRM 583 Div II Level Three:GameOnABoard,Dijkstra最短路径算法
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12556 用Dijkstra实现,之前用Floyd算法写了一个, ...
- SRM 223 Div II Level Two: BlackAndRed,O(N)复杂度
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3457&rd=5869 解答分析:http://comm ...
- SRM 207 Div II Level Two: RegularSeason,字符串操作(sstream),多关键字排序(操作符重载)
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=2866&rd=5853 主要是要对字符串的操作要熟悉,熟 ...
- SRM 219 Div II Level One: WaiterTipping,小心约分
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12609&rd=15503 这题目看上去so easy, ...
- SRM 212 Div II Level One: YahtzeeScore
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=1692&rd=5858 比较简单. 代码如下: #inc ...
- SRM 212 Div II Level Two: WinningRecord,Brute Force
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3003&rd=5858 比较简单. 代码如下: #inc ...
随机推荐
- ASP.NET身份验证的几种方式
1.windows身份验证 2. Forms验证 3.Passport验证 4.none http://www.jb51.net/article/30510.htm
- 毕业论文endnote使用
毕业论文的参考文献的标准格式,参考了一下文章 http://blog.sina.com.cn/s/blog_62a1f43801016fq5.html http://blog.csdn.net/zhe ...
- 【一】仿微信飞机大战cocos2d-x3.0rc1
參考 [偶尔e网事] 的 [cocos2d-x入门实战]微信飞机大战 cocos2dx 2.0版本号,偶尔e网事他写的很具体,面面俱到,大家很有必要看下.能够通过以下链接跳转: cocos2d-x入 ...
- Amazon的AWS账单看起来不是很方便
发了一个PDF格式的收据,只写了收取的费用,EC2下面的明细没有. DetailAmazon Simple Notification Service $0.00Charges $0.00Estimat ...
- 在ibatis下匹配特殊手机号码(oracle数据库)
<isNotNull prepend="AND" property="endNumber"> <isNotEmpty property=&qu ...
- DHCP的工作原理
什么是dhcp?它是如何实现的? DHCP称为动态主机配置协议.DHCP服务允许工作站连接到网络并且自动获取一个IP地址.配置DHCP服务的服务器可以为每一个网络客户提供一个IP地址.子网掩码.缺省网 ...
- Qt序列化格式分析(qint,QString)(非常简单好用)
最近项目需要进行QT开发环境下对传输对象进行序列化与反序列化处理,对基本类型的处理在使用QT默认的序列化方式还是完全手工序列化这两种方式之间有些犹疑不定,边想了解下QT默认序列化基本类型的格式,项目中 ...
- IntelliJ IDEA 开发swing(一)
原文:idea开发swing(一) 最近项目组需要开发一个swing小工具,以下是开发过程. 一.创建工程: 输入工程名称,选择java module,点击next 接下来什么都不选点击finish, ...
- stack around the variable “ ” was corrupted
用scanf格式控制不当经常发生此错误. 如 short int a=10; scanf("%d",&a); 应该是%hd; 一般是越界引起的. 参看:http://bl ...
- 【HTML5游戏开发小技巧】RPG情景对话中,令文本逐字输出
以前用JAVAscript实现过令文本逐字输出的效果,今天我来用html5中的canvas实现一下.canvas里的内容可不像<p>那样好操作,首先,你需要懂得一些html5的API才能操 ...