Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

GOD_magician's blog

By GOD_magician, history, 7 years ago, In English

They were used to do what?

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
7 years ago, # |
Rev. 2   Vote: I like it +5 Vote: I do not like it
What's the mean of y3487465 and y8687969

Okay, the mean of y3487465 and y8687969 is y6087717.

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You can't use some variable names in global namespace when 'using namespace std' is used like next, prev, y1 ... etc

To get around it some people use #define with random name like

#define next lolXD
  • »
    »
    7 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you,I know

  • »
    »
    7 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    According to you,when 'using namespace std'is used,we can't use y1,yes? But why I can use y1 successfully without #define like this: using namespace std; int ne[5][2]={{0,0},{1,0},{-1,0},{0,1},{0,-1}}; int a[41][41],n,m,best; void search(int x) { int i,j,f,k,xx,yy,x1,x2,y1,y2; vector<pair<int,int> >tmp;

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

      Try this in global namespace:

      long y1;
      

      The reason is that y1 is already declared in global namespace, it's safe when used locally