topcoder 594 DIV2 foxandclassroom

暴力枚举
1 #include <iostream>
#include <vector>
#include <string> using namespace std; class FoxAndClassroom{
public:
string ableTo(int n , int m){
for(int i = ; i < n ; ++ i ){
for(int j = ; j < m; ++ j ){
vector<vector<bool> > visitFlag(n,vector<bool>(m,false));
int kx = i ,ky = j,count = ;
while(!visitFlag[kx][ky]){
visitFlag[kx][ky] = true;
kx = (kx+)%n;
ky = (ky+)%m;
count++;
}
if(count == m*n) return "Possible";
}
}
return "Impossible";
} };
上一篇:struts2框架学习笔记5:OGNL表达式


下一篇:Struts2中OGNL表达式的用法