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 ...
随机推荐
- No persister for 编译器每行执行两次的解决方法
是前台的 js 的 datagrid 部件加了 oncheck 事件引起
- C语言--union关键字(转载)
union维护足够的空间来放置多个数据成员中的“一种”,而不是为每一个数据成员配置空间.在union中,所有的数据成员共用一个空间,同一时间只能存储其中一个数据成员,所有的数据成员具有相同的起始地址.
- 由基于qml,c++的串口调试工具浅谈qml与c++混合编程
最近在做一个基于sim900 的串口通信工具,基于qml和c++来实现. 首先,对于串口,qt有自带的QSerialPort,可以实现同步,和异步通信,qt creator也有自带的例子,本例子是从其 ...
- SolrCloud Hello Word
Solr Cloud 设计出来的目的是使你的搜索服务具有更高的可用性,提高容错.容灾能力.下面我们在一台电脑上建立2个solr服务,作为一个solrCloud分片(shard),初步认识一下solrC ...
- python爬虫实战2百度贴吧爬html
转自:http://blog.csdn.net/wxg694175346/article/details/8927832 import string, urllib2 #定义百度函数 def baid ...
- Global文件(修正篇)
什么是Global文件 Global.asax文件俗称为一个类,继承于Httpapplication类.位于应用程序根目录下.也可称为应用程序文件. 概述: Global文件是可选的,一般在创建应用程 ...
- Fruit Ninja(树状数组+思维)
Fruit Ninja Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- typeof 使用介绍
JS中的变量是松散类型(即弱类型)的,可以用来保存任何类型的数据. typeof 可以用来检测给定变量的数据类型,可能的返回值:1. 'undefined' --- 这个值未定义: 2. 'boole ...
- java--局部类只能访问外包方法的final局部成员
class B523{ // private int k = 10; public void go(int x, final int y){ // int a = x+y; final int b = ...
- haproxy /admin跳转 不会在接口上再次加上admin
http://www.xx.com/admin/api/menu [root@wx03 mojo]# cat test.pl use Mojolicious::Lite; use JSON qw/en ...