Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <vector>
- #include <queue>
- #include <set>
- #include <map>
- #include <cstdio>
- #include <cstdlib>
- #include <cctype>
- #include <cmath>
- using namespace std;
- typedef long long LL;
- #define FOR(k,a,b) for(int k(a); k < (b); ++k)
- #define REP(k,a) for(int k=0; k < (a); ++k)
- class BallsConverter {
- int calc(char c)
- {
- if(c>='A' && c<='Z')
- return c-'A';
- return c-'a'+26;
- }
- public:
- string theGood( vector <string> convert ) {
- int n=convert.size();
- REP(i,n)
- REP(j,n)
- {
- if(convert[i][j]!=convert[j][i])
- return "Bad";
- REP(k,n)
- {
- if(convert[i][calc(convert[j][k])]!=convert[j][calc(convert[i][k])])
- return "Bad";
- }
- }
- return "Good";
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment