226a376552 2011-12-28 kinaba: #include <iostream> 226a376552 2011-12-28 kinaba: #include <sstream> 226a376552 2011-12-28 kinaba: #include <iomanip> 226a376552 2011-12-28 kinaba: #include <vector> 226a376552 2011-12-28 kinaba: #include <string> 226a376552 2011-12-28 kinaba: #include <map> 226a376552 2011-12-28 kinaba: #include <set> 226a376552 2011-12-28 kinaba: #include <algorithm> 226a376552 2011-12-28 kinaba: #include <numeric> 226a376552 2011-12-28 kinaba: #include <iterator> 226a376552 2011-12-28 kinaba: #include <functional> 226a376552 2011-12-28 kinaba: #include <complex> 226a376552 2011-12-28 kinaba: #include <queue> 226a376552 2011-12-28 kinaba: #include <stack> 226a376552 2011-12-28 kinaba: #include <cmath> 226a376552 2011-12-28 kinaba: #include <cassert> 226a376552 2011-12-28 kinaba: #include <cstring> 226a376552 2011-12-28 kinaba: #ifdef __GNUC__ 226a376552 2011-12-28 kinaba: #include <ext/hash_map> 226a376552 2011-12-28 kinaba: #define unordered_map __gnu_cxx::hash_map 226a376552 2011-12-28 kinaba: #else 226a376552 2011-12-28 kinaba: #include <unordered_map> 226a376552 2011-12-28 kinaba: #endif 226a376552 2011-12-28 kinaba: using namespace std; 226a376552 2011-12-28 kinaba: typedef long long LL; 226a376552 2011-12-28 kinaba: typedef complex<double> CMP; 226a376552 2011-12-28 kinaba: 226a376552 2011-12-28 kinaba: class MagicStonesStore { public: 226a376552 2011-12-28 kinaba: string ableToDivide(int n) 226a376552 2011-12-28 kinaba: { 226a376552 2011-12-28 kinaba: return n==1 ? "NO" : "YES"; 226a376552 2011-12-28 kinaba: } 226a376552 2011-12-28 kinaba: }; 226a376552 2011-12-28 kinaba: 226a376552 2011-12-28 kinaba: // BEGIN CUT HERE 226a376552 2011-12-28 kinaba: #include <ctime> 226a376552 2011-12-28 kinaba: double start_time; string timer() 226a376552 2011-12-28 kinaba: { ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); } 226a376552 2011-12-28 kinaba: template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) 226a376552 2011-12-28 kinaba: { os << "{ "; 226a376552 2011-12-28 kinaba: for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it) 226a376552 2011-12-28 kinaba: os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; } 226a376552 2011-12-28 kinaba: void verify_case(const string& Expected, const string& Received) { 226a376552 2011-12-28 kinaba: bool ok = (Expected == Received); 226a376552 2011-12-28 kinaba: if(ok) cerr << "PASSED" << timer() << endl; else { cerr << "FAILED" << timer() << endl; 226a376552 2011-12-28 kinaba: cerr << "\to: \"" << Expected << '\"' << endl << "\tx: \"" << Received << '\"' << endl; } } 226a376552 2011-12-28 kinaba: #define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock(); 226a376552 2011-12-28 kinaba: #define END verify_case(_, MagicStonesStore().ableToDivide(n));} 226a376552 2011-12-28 kinaba: int main(){ 226a376552 2011-12-28 kinaba: 226a376552 2011-12-28 kinaba: CASE(0) 226a376552 2011-12-28 kinaba: int n = 1; 226a376552 2011-12-28 kinaba: string _ = "NO"; 226a376552 2011-12-28 kinaba: END 226a376552 2011-12-28 kinaba: CASE(1) 226a376552 2011-12-28 kinaba: int n = 2; 226a376552 2011-12-28 kinaba: string _ = "YES"; 226a376552 2011-12-28 kinaba: END 226a376552 2011-12-28 kinaba: CASE(2) 226a376552 2011-12-28 kinaba: int n = 3; 226a376552 2011-12-28 kinaba: string _ = "YES"; 226a376552 2011-12-28 kinaba: END 226a376552 2011-12-28 kinaba: CASE(3) 226a376552 2011-12-28 kinaba: int n = 5; 226a376552 2011-12-28 kinaba: string _ = "YES"; 226a376552 2011-12-28 kinaba: END 226a376552 2011-12-28 kinaba: CASE(4) 226a376552 2011-12-28 kinaba: int n = ; 226a376552 2011-12-28 kinaba: string _ = ; 226a376552 2011-12-28 kinaba: END 226a376552 2011-12-28 kinaba: CASE(5) 226a376552 2011-12-28 kinaba: int n = ; 226a376552 2011-12-28 kinaba: string _ = ; 226a376552 2011-12-28 kinaba: END 226a376552 2011-12-28 kinaba: 226a376552 2011-12-28 kinaba: } 226a376552 2011-12-28 kinaba: // END CUT HERE