double test3() { string t0[] = {"-LWWLWDLDWWWWWWDDWDW", "D-WWLDDWDWDLWDDWLWDD", "LL-DLDWDLDLDWWWLWDDW", "LDD-LLLDLWLWWWWDWDWL", "LWWW-DWDLWDWDWWWDWDW", "DLLWD-WWLLDDDLWWDWWW", "WWLWDL-LLDWWWWWDWWLW", "LLLLLDW-LDLWDDLLLDWL", "DWWWWDDD-DWWWWDWWWDW", "WWWWLLLWL-LWWWWWLWWW", "DWWWWWWWLW-WDWWWWWWW", "DDDLLLDWWWL-DDWDWLDD", "LWLWLDLLLDLW-DDDWWDD", "LLWWLWDDLWLWL-WWWDLL", "WWWWLLDDDWLWDD-WWWLW", "DLDLLLWWLLLWWLW-DWLL", "DLWWWLDLWWDWWDWL-WWD", "LLDDLLWLLWLWLDLWW-WW", "LLWLLLWWLWLWWDWWLD-W", "LLWDLWDWDWLLWWDDWWL-"}; vector <string> p0(t0, t0+sizeof(t0)/sizeof(string)); SoccerLeagues * obj = new SoccerLeagues(); clock_t start = clock(); vector <int> my_answer = obj->points(p0); clock_t end = clock(); delete obj; cout <<"Time: " <<(double)(end-start)/CLOCKS_PER_SEC <<" seconds" <<endl; int t1[] = {72, 62, 41, 41, 83, 63, 53, 35, 86, 50, 90, 32, 34, 41, 45, 36, 51, 32, 51, 45 }; vector <int> p1(t1, t1+sizeof(t1)/sizeof(int)); cout <<"Desired answer: " <<endl; cout <<"\t{ "; if (p1.size() > 0) { cout <<p1[0]; for (int i=1; i<p1.size(); i++) cout <<", " <<p1[i]; cout <<" }" <<endl; } else cout <<"}" <<endl; cout <<endl <<"Your answer: " <<endl; cout <<"\t{ "; if (my_answer.size() > 0) { cout <<my_answer[0]; for (int i=1; i<my_answer.size(); i++) cout <<", " <<my_answer[i]; cout <<" }" <<endl; } else cout <<"}" <<endl; if (my_answer != p1) { cout <<"DOESN'T MATCH!!!!" <<endl <<endl; return -1; } else { cout <<"Match :-)" <<endl <<endl; return (double)(end-start)/CLOCKS_PER_SEC; } }
int main(int argc, char *argv[]) { SoccerLeagues sl; vector<string> v1; vector<int> res; v1.push_back("-DD"); v1.push_back("L-L"); v1.push_back("WD-"); res = sl.points(v1); for (int i =0; i< res.size(); i++) cout<<res[i]<<endl; }
double test2() { string t0[] = {"-DWWD", "L-WLL", "DD-WD", "DDL-L", "DDLL-"}; vector <string> p0(t0, t0+sizeof(t0)/sizeof(string)); SoccerLeagues * obj = new SoccerLeagues(); clock_t start = clock(); vector <int> my_answer = obj->points(p0); clock_t end = clock(); delete obj; cout <<"Time: " <<(double)(end-start)/CLOCKS_PER_SEC <<" seconds" <<endl; int t1[] = {14, 7, 12, 8, 10 }; vector <int> p1(t1, t1+sizeof(t1)/sizeof(int)); cout <<"Desired answer: " <<endl; cout <<"\t{ "; if (p1.size() > 0) { cout <<p1[0]; for (int i=1; i<p1.size(); i++) cout <<", " <<p1[i]; cout <<" }" <<endl; } else cout <<"}" <<endl; cout <<endl <<"Your answer: " <<endl; cout <<"\t{ "; if (my_answer.size() > 0) { cout <<my_answer[0]; for (int i=1; i<my_answer.size(); i++) cout <<", " <<my_answer[i]; cout <<" }" <<endl; } else cout <<"}" <<endl; if (my_answer != p1) { cout <<"DOESN'T MATCH!!!!" <<endl <<endl; return -1; } else { cout <<"Match :-)" <<endl <<endl; return (double)(end-start)/CLOCKS_PER_SEC; } }