Submission #1214051

#TimeUsernameProblemLanguageResultExecution timeMemory
1214051NeltRobot Contest (IOI23_robot)C++20
Compilation error
0 ms0 KiB
#include "robot.h" #include <bits/stdc++.h> #pragma GCC optimize("O3") #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long #define endl "\n" using namespace std; using namespace __gnu_pbds; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); template <typename T, typename key = less<T>> using ordered_set = tree<T, null_type, key, rb_tree_tag, tree_order_statistics_node_update>; void program_pulibot() { auto move = [&](ll x) -> char { if (x == 2) return 'W'; if (x == 3) return 'S'; if (x == 4) return 'E'; return 'N'; }; ll v[] = {-2, -1, 0, 1, 2, 3, 4, 5}; for (ll s0 : v) for (ll s1 : v) for (ll s2 : v) for (ll s3 : v) for (ll s4 : v) { ll S[5] = {s0, s1, s2, s3, s4}; if (s0 == 0) { bool ok = 0; for (ll d = 0; d < 4; d++) { if (S[d + 1] == 0) { set_instruction(S, 2 + d, move(2 + d)); ok = 1; break; } } if (ok) continue; if (s2 == -2 && s3 == -2) { set_instruction(S, 1, 'T'); continue; } for (ll d = 0; d < 4; d++) { ll opp = 2 + (d ^ 1); if (S[d + 1] == opp) { set_instruction(S, 1, move(2 + (d ^ 1))); ok = 1; break; } } if (ok) continue; } if (s0 >= 2 && s0 <= 5) { set_instruction(S, 1, move(s0)); continue; } set_instruction(S, 0, 'H'); } }

Compilation message (stderr)

robot.cpp: In function 'void program_pulibot()':
robot.cpp:40:37: error: could not convert '(long long int*)(& S)' from 'long long int*' to 'std::vector<int>'
   40 |                     set_instruction(S, 2 + d, move(2 + d));
      |                                     ^
      |                                     |
      |                                     long long int*
robot.cpp:49:33: error: could not convert '(long long int*)(& S)' from 'long long int*' to 'std::vector<int>'
   49 |                 set_instruction(S, 1, 'T');
      |                                 ^
      |                                 |
      |                                 long long int*
robot.cpp:58:37: error: could not convert '(long long int*)(& S)' from 'long long int*' to 'std::vector<int>'
   58 |                     set_instruction(S, 1, move(2 + (d ^ 1)));
      |                                     ^
      |                                     |
      |                                     long long int*
robot.cpp:68:29: error: could not convert '(long long int*)(& S)' from 'long long int*' to 'std::vector<int>'
   68 |             set_instruction(S, 1, move(s0));
      |                             ^
      |                             |
      |                             long long int*
robot.cpp:72:25: error: could not convert '(long long int*)(& S)' from 'long long int*' to 'std::vector<int>'
   72 |         set_instruction(S, 0, 'H');
      |                         ^
      |                         |
      |                         long long int*