1 #include <iostream> 2 #include <string> 3 #include <algorithm> 4 5 using namespace std; 6 7 class WolfDelaymaster{ 8 public: 9 bool checkChar(string str, char c, int start ,int num){ 10 for(int i = start; i < start + num; ++ i ){ 11 if(str[i] != c) return false; 12 } 13 return true; 14 } 15 16 string check(string str){ 17 for(int i = 0; i < str.length();){ 18 int j = i; 19 while(str[j] == 'w' && ++ j); 20 int num = j - i; 21 if(num == 0 ) return "INVALID"; 22 if(checkChar(str,'0',j,num) && checkChar(str,'l',j+num,num) && checkChar(str,'f',j+2*num,num)) 23 { 24 i = j + 3*num; 25 } 26 else return "INVALID"; 27 } 28 return "VALID"; 29 } 30 31 };
topcoder SRM 593 DIV2 WolfDelaymaster
相關文章
- topcoder SRM 593 DIV2 RaiseThisBarnAI
- topcoder SRM 592 DIV2 LittleElephantAndBooks
- topcoder SRM 591 DIV2 TheArithmeticProgression
- topcoder SRM 628 DIV2 BishopMove
- topcoder SRM 628 DIV2 BracketExpressionsRacketExpress
- topcoder SRM 610 DIV2 TheMatrix
- Topcoder SRM 626 DIV2 SumOfPower
- topcoder SRM 624 DIV2 CostOfDancing
- topcoder SRM 625 DIV2 AddMultiply
- topcoder SRM 625 DIV2 IncrementingSequenceREMGse
- topcoder SRM 623 DIV2 CatAndRat
- topcoder SRM 594 DIV2 AstronomicalRecordsEasyAST
- topcoder SRM 610 DIV2 DivideByZeroIDE
- topcoder SRM 624 DIV2 BuildingHeightsEasyUI
- topcoder SRM 618 DIV2 WritingWords
- topcoder SRM 623 DIV2 CatchTheBeatEasy
- topcoder SRM 592 DIV2 LittleElephantAndPermutationDiv2
- Topcoder SRM646 DIV2 1000
- Topcoder SRM 626 DIV2 FixedDiceGameDiv2GAM
- topcoder SRM 617 DIV2 SlimeXSlimonadeTycoon
- topcoder SRM 618 DIV2 LongWordsDiv2
- topcoder SRM 619 DIV2 GoodCompanyDivTwoGo
- TopCoder SRM 588 DIV2 KeyDungeonDiv2
- Topcoder SRM 583 DIV2 SwappingDigitsAPPGit
- topcoder SRM 618 DIV2 MovingRooksDiv2
- topcoder SRM 622 DIV2 BoxesDiv2
- topcoder SRM 622 DIV2 FibonacciDiv2
- topcoder 594 DIV2 foxandclassroomOOM
- BZOJ2454 : TopCoder SRM 463 RabbitPuzzle
- Topcoder SRM 638 DIV 2 (大力出奇跡)
- TopCoder SRM 639 Div.2 500 AliceGameEasyGAM
- leetcode 593. Valid Square練習LeetCode
- leetcode 593. Valid Square 練習LeetCode
- 最安全的SRM錢包,SRM冷錢包使用教程
- Oracle 11G OCP 1Z0-053 593Oracle
- Codeforces #245(div2)
- SRM系統是什麼系統?如何應用SRM系統?
- codeforces #197(div2)