godfather_2000's blog

By godfather_2000, history, 11 days ago, In English,

Hi, I am currently facing trouble using Xcode for the first time. Previously I used lightweight online IDEs but now I feel the need to switch to an offline one. Since I use Mac I wanted some help on how to setup Xcode for CP. Also while copying large test cases from udebug I see Xcode is not able to run on them and provide the required output. And another problem I have been facing is using the header bits/stdc++.h in Xcode. I searched for a solution online and did something like this 52770619 but over here it showed compilation error.

I would be very happy if anyone can help me.

 
 
 
 

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

In CF, you just use #include<bits/stdc++.h> because the CF C++ compiler is GCC.

»
11 days ago, # |
  Vote: I like it 0 Vote: I do not like it

I am not sure but I think something like

#ifndef ONLINE_JUDGE
#include "your long include line"
#else
#include <bits/stdc++.h>
#endif

should work. I haven't tested it but you can try it. Let me know if it helped!

  • »
    »
    11 days ago, # ^ |
    Rev. 4   Vote: I like it 0 Vote: I do not like it

    It worked like magic... Thanks :) Do u also use Xcode?

    • »
      »
      »
      11 days ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      No, I don't. It was just a quick idea I had. If you want to use it on other OJs where they do not define ONLINE_JUDGE you can change the syntax a bit like

      #ifdef YOUR_DEFINE
      #include <"your long include line"
      #else
      #include <bits/stdc++.h>
      #endif
      

      and compile defining YOUR_DEFINE like you defined _DEBUG. I am glad I could help you :)