Submission #654377

#TimeUsernameProblemLanguageResultExecution timeMemory
654377atigunFlight to the Ford (BOI22_communication)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; void encode(int N, int X){ vector<int> v; for(int bit = 0; bit <= 2; bit++){ bool on = (X >> bit)&1; v.push_back(send(on)); v.push_back(send(on)); while(v.end()[-1] != v.end()[-2]) v.push_back(send(on)); } } pair<int, int> decode(int N){ int solution = 0; vector<int> v; for(int bit = 0; bit <= 2; bit++){ bool on = 0; v.push_back(receive()); v.push_back(receive()); while(v.end()[-1] != v.end()[-2]) v.push_back(receive()); if(v.end()[-1]) solution|= (1<<bit); } return make_pair(solution, solution); } void solve{ } int main(){ ios::sync_with_stdio(false); cin.tie(0); int tt = 1; // cin >> tt; while(tt--){ solve(); } }

Compilation message (stderr)

communication.cpp: In function 'void encode(int, int)':
communication.cpp:10:17: error: 'send' was not declared in this scope
   10 |     v.push_back(send(on));
      |                 ^~~~
communication.cpp: In function 'std::pair<int, int> decode(int)':
communication.cpp:22:17: error: 'receive' was not declared in this scope
   22 |     v.push_back(receive());
      |                 ^~~~~~~
communication.cpp:21:10: warning: unused variable 'on' [-Wunused-variable]
   21 |     bool on = 0;
      |          ^~
communication.cpp: At global scope:
communication.cpp:32:6: error: variable or field 'solve' declared void
   32 | void solve{
      |      ^~~~~