MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

Hackerrank_problems/kangaroo/solution5.cpp:60–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int main()
61{
62 ofstream fout(getenv("OUTPUT_PATH"));
63
64 string x1V1X2V2_temp;
65 getline(cin, x1V1X2V2_temp);
66
67 vector<string> x1V1X2V2 = split_string(x1V1X2V2_temp);
68
69 int x1 = stoi(x1V1X2V2[0]);
70
71 int v1 = stoi(x1V1X2V2[1]);
72
73 int x2 = stoi(x1V1X2V2[2]);
74
75 int v2 = stoi(x1V1X2V2[3]);
76
77 string result = kangaroo(x1, v1, x2, v2);
78
79 fout << result << "\n";
80
81 fout.close();
82
83 return 0;
84}
85
86vector<string> split_string(string input_string) {
87 string::iterator new_end = unique(input_string.begin(), input_string.end(), [] (const char &x, const char &y) {

Callers

nothing calls this directly

Calls 2

split_stringFunction · 0.70
kangarooFunction · 0.70

Tested by

no test coverage detected