Preprocessor Solution

Sort by

recency

|

185 Discussions

|

  • + 0 comments
    #define foreach(arg1, arg2) for(int i = 0; i < n; i++)
    #define io(arg) cin >> v
    
    #define INF 100000000
    
    
    #define minimum(arg1, arg2) if(arg1 > arg2) arg1 = arg2;
    #define maximum(arg1, arg2) if(arg1 < arg2) arg1 = arg2;
    
    #define FUNCTION(arg1, arg2) //
    
    #define toStr(arg) "Result ="
    
  • + 0 comments

    This has to be the worst defined problem that I had ever solved. Literally.

  • + 0 comments

    include #include

    include #define subtract(a,b) a-b

    int main() { int t;std::cin>>t; std::vector vec; for(int i=0, a;i>a, vec.push_back(a); auto maxi=std::max_element(vec.begin(),vec.end()), mini=std::min_element(vec.begin(),vec.end()); std::cout<<"Result = "<

  • + 0 comments
    #define toStr(x) #x
    #define io(v) cin >> v
    #define INF 100000000
    #define foreach(v, i) for(int i = 0; i < v.size(); i++)
    #define FUNCTION(name, op) void name(int& a, int b) { if (b op a) a = b; }
    
  • + 0 comments

    Macros:

    #define toStr(x) #x
    #define io(v) cin >> v 
    #define FUNCTION(name, op) inline void name(int &x, int y) {if(y op x) x = y;}
    #define INF 10000000
    #define foreach(v, i) for(int i = 0; i < v.size(); i++)