topcoder SRM 593 DIV2 WolfDelaymaster
#include <iostream>
#include <string>
#include <algorithm> using namespace std; class WolfDelaymaster{
public:
bool checkChar(string str, char c, int start ,int num){
for(int i = start; i < start + num; ++ i ){
if(str[i] != c) return false;
}
return true;
} string check(string str){
for(int i = ; i < str.length();){
int j = i;
while(str[j] == 'w' && ++ j);
int num = j - i;
if(num == ) return "INVALID";
if(checkChar(str,'',j,num) && checkChar(str,'l',j+num,num) && checkChar(str,'f',j+*num,num))
{
i = j + *num;
}
else return "INVALID";
}
return "VALID";
} };
topcoder SRM 593 DIV2 WolfDelaymaster的更多相关文章
- topcoder SRM 593 DIV2 RaiseThisBarn
#include <vector> #include <string> #include <list> #include <map> #include ...
- Topcoder Srm 673 Div2 1000 BearPermutations2
\(>Topcoder \space Srm \space 673 \space Div2 \space 1000 \space BearPermutations2<\) 题目大意 : 对 ...
- Topcoder Srm 671 Div2 1000 BearDestroysDiv2
\(>Topcoder \space Srm \space 671 \space Div2 \space 1000 \space BearDestroysDiv2<\) 题目大意 : 有一 ...
- 求拓扑排序的数量,例题 topcoder srm 654 div2 500
周赛时遇到的一道比较有意思的题目: Problem Statement There are N rooms in Maki's new house. The rooms are number ...
- Topcoder srm 632 div2
脑洞太大,简单东西就是想复杂,活该一直DIV2; A:水,基本判断A[I]<=A[I-1],ANS++; B:不知道别人怎么做的,我的是100*N*N;没办法想的太多了,忘记是连续的数列 我们枚 ...
- topcoder SRM 628 DIV2 BracketExpressions
先用dfs搜索所有的情况,然后判断每种情况是不是括号匹配 #include <vector> #include <string> #include <list> # ...
- topcoder SRM 628 DIV2 BishopMove
题目比较简单. 注意看测试用例2,给的提示 Please note that this is the largest possible return value: whenever there is ...
- Topcoder SRM 683 Div2 B
贪心的题,从左向右推过去即可 #include <vector> #include <list> #include <map> #include <set&g ...
- Topcoder SRM 683 Div2 - C
树形Dp的题,根据题意建树. DP[i][0] 表示以i为根节点的树的包含i的时候的所有状态点数的总和 Dp[i][1] 表示包含i结点的状态数目 对于一个子节点v Dp[i][0] = (Dp[v] ...
随机推荐
- Python Django 的 django templatedoesnotexist
django 1.8版本的解决方案 在 setting.py 这个文件里 TEMPLATES = [ ...... #原来的 #'DIRS': [ ], // 这个 列表里添加 template路 ...
- Android 云服务器的搭建和友盟APP自动更新功能的实现
setContentView(R.layout.activity_splash); //Bmob SDK初始化--只需要这一段代码即可完成初始化 //请到Bmob官网(http://www.bmob. ...
- SHSEE 备战最后十(四)天日记
努力. Day -1 看书.睡觉. Day 0 上午考试.语文纯RP题跪.理总不错. 下午上课,各种神. Day 1 上午下午讲课...Day 0成绩出来才#17.... Day 2 考试..这次题目 ...
- 【OpenStack】OpenStack系列10之Horizon详解
一.参考其他资料即可.可以采用haproxy+apache+horizon方式部署,haproxy/httpd支持ssl.
- tcp/IP点对点通信程序
点对点的通信 服务器端与客户端在建立连接之后创建一个进程 服务器端: 子进程用于接收主机的输入并将数据发送出去.父进程用于接收客户端的数据并输出到主机. 子进程一直等待主机的输入,输入的数据放在发送缓 ...
- c#ASP.NET中页面传值共有这么几种方式
一.目前在ASP.NET中页面传值共有这么几种方式: 1.Response.Redirect("http://www.hao123.com",false); 目标页面和原页面可以在 ...
- js init : function ()
这个init外面应该还有一层,比如 var a = { init: function () {...}, exit: function () {...} } 这样的话,可以用a.init()来调用这个 ...
- 54. 八皇后问题[eight queens puzzle]
[本文链接] http://www.cnblogs.com/hellogiser/p/eight-queens-puzzle.html [题目] 在8×8的国际象棋上摆放八个皇后,使其不能相互攻击,即 ...
- 惊魂web应用宕机记一次网站的紧急恢复
这次网站的故障出现的比较突然,没有任何防备,有种突如其来的感觉.这是一台阿里云服务器,采用wdcp的nginx+apache+mysql的方式运行.一位同事在对web目录进行压缩后,由于web目录有很 ...
- css样式,层叠顺序属性z-index
在做项目的时候,居然单击后显示的顺序一直被别的li标签压着,最后终于找到了,是css的z-index属性赋值了,值越大,显示的层就越高 详情推荐百度百科:z-index z-index是针对网页显示中 ...