Submission #715207

#TimeUsernameProblemLanguageResultExecution timeMemory
715207duchuy297Ancient Machine (JOI21_ancient_machine)C++17
Compilation error
0 ms0 KiB
#include "Anna.h" #include <vector> namespace { int variable_example = 0; } void Anna(int N, std::vector<char> S) { for (auto u : S) { if (u == 'X') send (0), send (0); else if (u == 'Y') send (0), send(1); else send (1), send(0); } }
#include "Bruno.h" #include <vector> namespace { int variable_example = 0; int FunctionExample(int P) { return 1 - P; } } // namespace void Bruno(int N, int L, std::vector<int> A) { string s; int n = N; for (int i=0; i<2*n; i+=2) { if (s[i] == 0 && s[i+1] == 0) s.push_back('X'); else if (s[i] == 0 && s[i+1] == 1) s.push_back('Y'); else s.push_back('Z'); } int l = -1, r = -1; for (int i=0; i<n; i++) { if (s[i] == 'X') { l = i; break; } } for (int i=n-1; i>=0; i--) { if (s[i] == 'Z') { r = i; break; } } if (l == -1 || r == -1) { for (int i=0; i<n; i++) remove(i); return; } for (int i=0; i<l; i++) remove(i); for (int i=r+1; i<n; i++) remove(i); stack<int> st; st.push(l); for (int i=l+1; i<=r; i++) { int u = st.top(); if (s[i] == s[u]) { remove(i); continue; } if (s[i] == 'Z') { while (st.size() > 1) { int u = st.top(); remove(u); st.pop(); } } else st.push(i); } while (st.size()) { int u = st.top(); remove(u); st.pop(); } }

Compilation message (stderr)

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:12:17: error: 'send' was not declared in this scope; did you mean 'Send'?
   12 |   if (u == 'X') send (0), send (0);
      |                 ^~~~
      |                 Send
Anna.cpp:13:22: error: 'send' was not declared in this scope; did you mean 'Send'?
   13 |   else if (u == 'Y') send (0), send(1);
      |                      ^~~~
      |                      Send
Anna.cpp:14:8: error: 'send' was not declared in this scope; did you mean 'Send'?
   14 |   else send (1), send(0);
      |        ^~~~
      |        Send
Anna.cpp: At global scope:
Anna.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    6 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~

Bruno.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Bruno.cpp:13:2: error: 'string' was not declared in this scope
   13 |  string s;
      |  ^~~~~~
Bruno.cpp:16:8: error: 's' was not declared in this scope
   16 |    if (s[i] == 0 && s[i+1] == 0) s.push_back('X');
      |        ^
Bruno.cpp:22:9: error: 's' was not declared in this scope
   22 |     if (s[i] == 'X') {
      |         ^
Bruno.cpp:28:9: error: 's' was not declared in this scope
   28 |     if (s[i] == 'Z') {
      |         ^
Bruno.cpp:34:29: error: 'remove' was not declared in this scope; did you mean 'Remove'?
   34 |     for (int i=0; i<n; i++) remove(i);
      |                             ^~~~~~
      |                             Remove
Bruno.cpp:37:28: error: 'remove' was not declared in this scope; did you mean 'Remove'?
   37 |    for (int i=0; i<l; i++) remove(i);
      |                            ^~~~~~
      |                            Remove
Bruno.cpp:38:30: error: 'remove' was not declared in this scope; did you mean 'Remove'?
   38 |    for (int i=r+1; i<n; i++) remove(i);
      |                              ^~~~~~
      |                              Remove
Bruno.cpp:39:4: error: 'stack' was not declared in this scope
   39 |    stack<int> st;
      |    ^~~~~
Bruno.cpp:39:10: error: expected primary-expression before 'int'
   39 |    stack<int> st;
      |          ^~~
Bruno.cpp:40:4: error: 'st' was not declared in this scope; did you mean 'std'?
   40 |    st.push(l);
      |    ^~
      |    std
Bruno.cpp:43:10: error: 's' was not declared in this scope
   43 |      if (s[i] == s[u]) {
      |          ^
Bruno.cpp:44:7: error: 'remove' was not declared in this scope; did you mean 'Remove'?
   44 |       remove(i);
      |       ^~~~~~
      |       Remove
Bruno.cpp:47:7: error: 's' was not declared in this scope
   47 |   if (s[i] == 'Z') {
      |       ^
Bruno.cpp:50:5: error: 'remove' was not declared in this scope; did you mean 'Remove'?
   50 |     remove(u);
      |     ^~~~~~
      |     Remove
Bruno.cpp:58:5: error: 'remove' was not declared in this scope; did you mean 'Remove'?
   58 |     remove(u);
      |     ^~~~~~
      |     Remove
Bruno.cpp: At global scope:
Bruno.cpp:8:5: warning: 'int {anonymous}::FunctionExample(int)' defined but not used [-Wunused-function]
    8 | int FunctionExample(int P) { return 1 - P; }
      |     ^~~~~~~~~~~~~~~
Bruno.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    6 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~