暴力列舉
1 #include <iostream> 2 #include <vector> 3 #include <string> 4 5 using namespace std; 6 7 class FoxAndClassroom{ 8 public: 9 string ableTo(int n , int m){ 10 for(int i = 0 ; i < n ; ++ i ){ 11 for(int j = 0 ; j < m; ++ j ){ 12 vector<vector<bool> > visitFlag(n,vector<bool>(m,false)); 13 int kx = i ,ky = j,count = 0; 14 while(!visitFlag[kx][ky]){ 15 visitFlag[kx][ky] = true; 16 kx = (kx+1)%n; 17 ky = (ky+1)%m; 18 count++; 19 } 20 if(count == m*n) return "Possible"; 21 } 22 } 23 return "Impossible"; 24 } 25 26 };
topcoder 594 DIV2 foxandclassroom
相關文章
- topcoder SRM 594 DIV2 AstronomicalRecordsEasyAST
- topcoder SRM 592 DIV2 LittleElephantAndBooks
- topcoder SRM 593 DIV2 RaiseThisBarnAI
- topcoder SRM 593 DIV2 WolfDelaymasterAST
- 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 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
- Oracle 11G OCP 1Z0-053 594Oracle
- Codeforces #245(div2)
- Oracle OCP IZ0-053 Q594(RMAN Image Copy)Oracle
- BZOJ2454 : TopCoder SRM 463 RabbitPuzzle
- codeforces #197(div2)
- codeforces #198(div2)
- Topcoder SRM 638 DIV 2 (大力出奇跡)
- TopCoder SRM 639 Div.2 500 AliceGameEasyGAM
- Codeforces Round #470 div2 C
- Codeforces Round #FF(255) DIV2