Submission #370449

#TimeUsernameProblemLanguageResultExecution timeMemory
370449casperwangXoractive (IZhO19_xoractive)C++14
Compilation error
0 ms0 KiB
#include "interactive.h" #include <bits/stdc++.h> using namespace std; #define debug(args) kout("[ " + string(#args) + " ]", args) void kout() { cerr << endl; } template <class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ',kout(b...); } template <class T> void pary(T L, T R) { while (L != R) cerr << *L << " \n"[++L==R]; } vector<int> guess(int n) { vector <int> G; for (int i = 2; i <= n; i++) G.pb(i); vector <int> exp = get_pairwise_xor(G); G.pb(1); vector <int> all = get_pairwise_xor(G); vector <int> ans(n); set <int> nums; ans[0] = ask(1); for (int i = 0, j = 0; i < exp.size(); i++) { while (all[j] != exp[i]) nums.insert(all[j++] ^ ans[0]); } assert(nums.size() == n); return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:13:7: error: 'class std::vector<int>' has no member named 'pb'
   13 |     G.pb(i);
      |       ^~
Xoractive.cpp:15:5: error: 'class std::vector<int>' has no member named 'pb'
   15 |   G.pb(1);
      |     ^~
Xoractive.cpp:21:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |   for (int i = 0, j = 0; i < exp.size(); i++) {
      |                          ~~^~~~~~~~~~~~
In file included from /usr/include/c++/9/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:33,
                 from Xoractive.cpp:2:
Xoractive.cpp:24:22: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   24 |   assert(nums.size() == n);
      |          ~~~~~~~~~~~~^~~~