Submission #478398

#TimeUsernameProblemLanguageResultExecution timeMemory
478398blueVision Program (IOI19_vision)C++17
Compilation error
0 ms0 KiB
#include "vision.h" #include <vector> using namespace std; #define a add_and; #define o add_or; #define pb push_back; int C(int H,int W,int K){ vector<int> M[450]; vector<int> O[450]; for(int i = 0; i < H*W; i++){ M[i/W+int(i%W)].pb(i); O[i/W-int(i%W)+W-1].pb(i); } vector<int> P,Q,R,S,T; for(int d=0;d<=H+W-2;d++){ P.pb(o(main_list[d])); Q.pb(o(P)); R.pb(o(opp_list[d])); S.pb(o(R)); if(d-K >= 0){ T.push_back(a({P[d], Q[d-K]})); T.push_back(a({R[d], S[d-K]})); } } return o(T); } void construct_network(int H, int W, int K){ if(K==H+W-2)C(H, W, K); else add_xor({C(H, W, K),C(H, W, K+1)}); }

Compilation message (stderr)

vision.cpp: In function 'int C(int, int, int)':
vision.cpp:6:12: error: statement cannot resolve address of overloaded function
    6 | #define pb push_back;
      |            ^
vision.cpp:11:25: note: in expansion of macro 'pb'
   11 |         M[i/W+int(i%W)].pb(i);
      |                         ^~
vision.cpp:11:28: warning: statement has no effect [-Wunused-value]
   11 |         M[i/W+int(i%W)].pb(i);
      |                           ~^~
vision.cpp:6:12: error: statement cannot resolve address of overloaded function
    6 | #define pb push_back;
      |            ^
vision.cpp:12:29: note: in expansion of macro 'pb'
   12 |         O[i/W-int(i%W)+W-1].pb(i);
      |                             ^~
vision.cpp:12:32: warning: statement has no effect [-Wunused-value]
   12 |         O[i/W-int(i%W)+W-1].pb(i);
      |                               ~^~
vision.cpp:6:12: error: statement cannot resolve address of overloaded function
    6 | #define pb push_back;
      |            ^
vision.cpp:16:11: note: in expansion of macro 'pb'
   16 |         P.pb(o(main_list[d]));
      |           ^~
vision.cpp:5:17: error: expected ')' before ';' token
    5 | #define o add_or;
      |                 ^
vision.cpp:16:14: note: in expansion of macro 'o'
   16 |         P.pb(o(main_list[d]));
      |              ^
vision.cpp:16:13: note: to match this '('
   16 |         P.pb(o(main_list[d]));
      |             ^
vision.cpp:5:11: warning: statement is a reference, not call, to function 'add_or' [-Waddress]
    5 | #define o add_or;
      |           ^
vision.cpp:16:14: note: in expansion of macro 'o'
   16 |         P.pb(o(main_list[d]));
      |              ^
vision.cpp:5:11: warning: statement has no effect [-Wunused-value]
    5 | #define o add_or;
      |           ^
vision.cpp:16:14: note: in expansion of macro 'o'
   16 |         P.pb(o(main_list[d]));
      |              ^
vision.cpp:16:16: error: 'main_list' was not declared in this scope; did you mean 'va_list'?
   16 |         P.pb(o(main_list[d]));
      |                ^~~~~~~~~
      |                va_list
vision.cpp:6:12: error: statement cannot resolve address of overloaded function
    6 | #define pb push_back;
      |            ^
vision.cpp:17:11: note: in expansion of macro 'pb'
   17 |         Q.pb(o(P));
      |           ^~
vision.cpp:5:17: error: expected ')' before ';' token
    5 | #define o add_or;
      |                 ^
vision.cpp:17:14: note: in expansion of macro 'o'
   17 |         Q.pb(o(P));
      |              ^
vision.cpp:17:13: note: to match this '('
   17 |         Q.pb(o(P));
      |             ^
vision.cpp:5:11: warning: statement is a reference, not call, to function 'add_or' [-Waddress]
    5 | #define o add_or;
      |           ^
vision.cpp:17:14: note: in expansion of macro 'o'
   17 |         Q.pb(o(P));
      |              ^
vision.cpp:5:11: warning: statement has no effect [-Wunused-value]
    5 | #define o add_or;
      |           ^
vision.cpp:17:14: note: in expansion of macro 'o'
   17 |         Q.pb(o(P));
      |              ^
vision.cpp:17:18: error: expected ';' before ')' token
   17 |         Q.pb(o(P));
      |                  ^
      |                  ;
vision.cpp:17:16: warning: statement has no effect [-Wunused-value]
   17 |         Q.pb(o(P));
      |               ~^~
vision.cpp:6:12: error: statement cannot resolve address of overloaded function
    6 | #define pb push_back;
      |            ^
vision.cpp:18:11: note: in expansion of macro 'pb'
   18 |         R.pb(o(opp_list[d]));
      |           ^~
vision.cpp:5:17: error: expected ')' before ';' token
    5 | #define o add_or;
      |                 ^
vision.cpp:18:14: note: in expansion of macro 'o'
   18 |         R.pb(o(opp_list[d]));
      |              ^
vision.cpp:18:13: note: to match this '('
   18 |         R.pb(o(opp_list[d]));
      |             ^
vision.cpp:5:11: warning: statement is a reference, not call, to function 'add_or' [-Waddress]
    5 | #define o add_or;
      |           ^
vision.cpp:18:14: note: in expansion of macro 'o'
   18 |         R.pb(o(opp_list[d]));
      |              ^
vision.cpp:5:11: warning: statement has no effect [-Wunused-value]
    5 | #define o add_or;
      |           ^
vision.cpp:18:14: note: in expansion of macro 'o'
   18 |         R.pb(o(opp_list[d]));
      |              ^
vision.cpp:18:16: error: 'opp_list' was not declared in this scope
   18 |         R.pb(o(opp_list[d]));
      |                ^~~~~~~~
vision.cpp:6:12: error: statement cannot resolve address of overloaded function
    6 | #define pb push_back;
      |            ^
vision.cpp:19:11: note: in expansion of macro 'pb'
   19 |         S.pb(o(R));
      |           ^~
vision.cpp:5:17: error: expected ')' before ';' token
    5 | #define o add_or;
      |                 ^
vision.cpp:19:14: note: in expansion of macro 'o'
   19 |         S.pb(o(R));
      |              ^
vision.cpp:19:13: note: to match this '('
   19 |         S.pb(o(R));
      |             ^
vision.cpp:5:11: warning: statement is a reference, not call, to function 'add_or' [-Waddress]
    5 | #define o add_or;
      |           ^
vision.cpp:19:14: note: in expansion of macro 'o'
   19 |         S.pb(o(R));
      |              ^
vision.cpp:5:11: warning: statement has no effect [-Wunused-value]
    5 | #define o add_or;
      |           ^
vision.cpp:19:14: note: in expansion of macro 'o'
   19 |         S.pb(o(R));
      |              ^
vision.cpp:19:18: error: expected ';' before ')' token
   19 |         S.pb(o(R));
      |                  ^
      |                  ;
vision.cpp:19:16: warning: statement has no effect [-Wunused-value]
   19 |         S.pb(o(R));
      |               ~^~
vision.cpp:4:18: error: expected ')' before ';' token
    4 | #define a add_and;
      |                  ^
vision.cpp:21:25: note: in expansion of macro 'a'
   21 |             T.push_back(a({P[d], Q[d-K]}));
      |                         ^
vision.cpp:21:24: note: to match this '('
   21 |             T.push_back(a({P[d], Q[d-K]}));
      |                        ^
vision.cpp:21:40: error: expected ';' before '}' token
   21 |             T.push_back(a({P[d], Q[d-K]}));
      |                                        ^
      |                                        ;
vision.cpp:21:42: error: expected ';' before ')' token
   21 |             T.push_back(a({P[d], Q[d-K]}));
      |                                          ^
      |                                          ;
vision.cpp:4:18: error: expected ')' before ';' token
    4 | #define a add_and;
      |                  ^
vision.cpp:22:25: note: in expansion of macro 'a'
   22 |             T.push_back(a({R[d], S[d-K]}));
      |                         ^
vision.cpp:22:24: note: to match this '('
   22 |             T.push_back(a({R[d], S[d-K]}));
      |                        ^
vision.cpp:22:40: error: expected ';' before '}' token
   22 |             T.push_back(a({R[d], S[d-K]}));
      |                                        ^
      |                                        ;
vision.cpp:22:42: error: expected ';' before ')' token
   22 |             T.push_back(a({R[d], S[d-K]}));
      |                                          ^
      |                                          ;
vision.cpp:5:11: error: invalid conversion from 'int (*)(std::vector<int>)' to 'int' [-fpermissive]
    5 | #define o add_or;
      |           ^~~~~~
      |           |
      |           int (*)(std::vector<int>)
vision.cpp:25:12: note: in expansion of macro 'o'
   25 |     return o(T);
      |            ^
vision.cpp:25:14: warning: statement has no effect [-Wunused-value]
   25 |     return o(T);
      |             ~^~