bool KawigiEdit_RunTest(int testNum, long long p0, long long p1, long long p2, long long p3, bool hasAnswer, string p4) { cout << "Test " << testNum << ": [" << p0 << "," << p1 << "," << p2 << "," << p3; cout << "]" << endl; AlternateColors *obj; string answer; obj = new AlternateColors(); clock_t startTime = clock(); answer = obj->getColor(p0, p1, p2, p3); clock_t endTime = clock(); delete obj; bool res; res = true; cout << "Time: " << double(endTime - startTime) / CLOCKS_PER_SEC << " seconds" << endl; if (hasAnswer) { cout << "Desired answer:" << endl; cout << "\t" << "\"" << p4 << "\"" << endl; } cout << "Your answer:" << endl; cout << "\t" << "\"" << answer << "\"" << endl; if (hasAnswer) { res = answer == p4; } if (!res) { cout << "DOESN'T MATCH!!!!" << endl; } else if (double(endTime - startTime) / CLOCKS_PER_SEC >= 2) { cout << "FAIL the timeout" << endl; res = false; } else if (hasAnswer) { cout << "Match :-)" << endl; } else { cout << "OK, but is it right?" << endl; } cout << "" << endl; return res; }
int main() { AlternateColors s; while (true) { long long a, g, b, k; cin>>a>>g>>b>>k; cout<<s.getColor(a, g, b, k)<<endl; } return 0; }