You are viewing a single comment's thread. Return to all comments →
Since I found the exercise a bit unnecessary, I made some shortcuts to avoid using variables in some places. My solution is:
#define toStr(X) "Result =" #define io(VEC) cin >> VEC #define FUNCTION(FUNNAME, OP) \ void FUNNAME(int &m, int num){ \ if (num OP m){ \ m = num; \ } \ } \ #define foreach(V, I) for(int I = 0; I < n; I++) #define INF 999999
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Preprocessor Solution
You are viewing a single comment's thread. Return to all comments →
Since I found the exercise a bit unnecessary, I made some shortcuts to avoid using variables in some places. My solution is: