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

Function main

Hackerrank_problems/3D_Surface_Area/solution2.cpp:53–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53int main()
54{
55 ofstream fout(getenv("OUTPUT_PATH"));
56
57 string HW_temp;
58 getline(cin, HW_temp);
59
60 vector<string> HW = split_string(HW_temp);
61
62 int H = stoi(HW[0]);
63
64 int W = stoi(HW[1]);
65
66 vector<vector<int>> A(H);
67 for (int i = 0; i < H; i++) {
68 A[i].resize(W);
69
70 for (int j = 0; j < W; j++) {
71 cin >> A[i][j];
72 }
73
74 cin.ignore(numeric_limits<streamsize>::max(), '\n');
75 }
76
77 int result = surfaceArea(A);
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 3

maxFunction · 0.85
surfaceAreaFunction · 0.85
split_stringFunction · 0.70

Tested by

no test coverage detected