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 __init__ __call__
__call__ 和 __init__半毛钱的关系都没有. 后者是构造类的实例时会调用的方法,并不是构造方法. 前者是在实例上可以呼叫的方法.代码示例如下: >>> class fo ...
- sharepoint更新多行文本webparth
前台 <script> function Copy() { var value = document.getElementById("<%=BodyBox.ClientID ...
- explict关键字
[本文链接] http://www.cnblogs.com/hellogiser/p/explict.html [分析] explicit 只对构造函数起作用,用来抑制隐式转换. Suppose yo ...
- codeforces 474D.Flowers 解题报告
题目链接:http://codeforces.com/problemset/problem/474/D 题目意思:Marmot 吃两种类型的花(实在难以置信呀--):red 或者 white,如果要吃 ...
- jquery去掉或者替换字符,设置指定options为selected状态
<html> <body> <div><select id="queryYear"> <opt ...
- Codeforces 389B(十字模拟)
Fox and Cross Time Limit: 1000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u Submi ...
- ios获取一个文件夹下的文件(夹)列表
NSArray* ary=[[NSFileManager defaultManager] contentsOfDirectoryAtPath:[[NSBundle mainBundle] pathFo ...
- [Android Memory] Android Zipalign zip对齐优化app程序
转载地址:http://www.cnblogs.com/xirihanlin/archive/2010/04/12/1710164.html 参考文章:http://www.cnblogs.com/l ...
- Mac相关命令
1,查询端口占用与Kill相应进程 lsof -i:端口,查询端口的占用情况 kill PID,关闭指定PID的进程. 如: localhost:~ tianjingcheng$ kill 729 l ...
- mysql:表注释和字段注释
mysql:表注释和字段注释 1 创建表的时候写注释 create table test1 ( field_name int comment '字段的注释' )comment='表的注释'; 2 修改 ...