Submission #721189

# Submission time Handle Problem Language Result Execution time Memory
721189 2023-04-10T13:32:19 Z bin9638 Comparing Plants (IOI20_plants) C++17
Compilation error
0 ms 0 KB
  int vt=x;
        for(int k=LOG;k>=0;k--)
            if(pre[vt][k]!=-1&&!(pre[vt][k]>x&&pre[vt][k]<=y)&&dis(pre[vt][k],y)>k-1)
                vt=pre[vt][k];
        if(dis(vt,y)>k-1)
            vt=pre[vt][0];
        if(vt!=-1&&h[vt]>=h[y])
            return 1;
        vt=x;
        for(int k=LOG;k>=0;k--)
            if(nxt[vt][k]!=-1&&(nxt[vt][k]>=x&&nxt[vt][k]<=y)&&dis(nxt[vt][k],y)>k-1)
                vt=nxt[vt][k];
         if(dis(vt,y)>k-1)
            vt=nxt[vt][0];
         if(vt!=-1&&h[vt]>=h[y])
            return 1;

Compilation message

plants.cpp:1:10: error: 'x' was not declared in this scope
    1 |   int vt=x;
      |          ^
plants.cpp:2:9: error: expected unqualified-id before 'for'
    2 |         for(int k=LOG;k>=0;k--)
      |         ^~~
plants.cpp:2:23: error: 'k' does not name a type
    2 |         for(int k=LOG;k>=0;k--)
      |                       ^
plants.cpp:2:28: error: 'k' does not name a type
    2 |         for(int k=LOG;k>=0;k--)
      |                            ^
plants.cpp:5:9: error: expected unqualified-id before 'if'
    5 |         if(dis(vt,y)>k-1)
      |         ^~
plants.cpp:7:9: error: expected unqualified-id before 'if'
    7 |         if(vt!=-1&&h[vt]>=h[y])
      |         ^~
plants.cpp:9:9: error: 'vt' does not name a type
    9 |         vt=x;
      |         ^~
plants.cpp:10:9: error: expected unqualified-id before 'for'
   10 |         for(int k=LOG;k>=0;k--)
      |         ^~~
plants.cpp:10:23: error: 'k' does not name a type
   10 |         for(int k=LOG;k>=0;k--)
      |                       ^
plants.cpp:10:28: error: 'k' does not name a type
   10 |         for(int k=LOG;k>=0;k--)
      |                            ^
plants.cpp:13:10: error: expected unqualified-id before 'if'
   13 |          if(dis(vt,y)>k-1)
      |          ^~
plants.cpp:15:10: error: expected unqualified-id before 'if'
   15 |          if(vt!=-1&&h[vt]>=h[y])
      |          ^~