Submission #344919

#TimeUsernameProblemLanguageResultExecution timeMemory
344919RakhmandXoractive (IZhO19_xoractive)C++14
100 / 100
8 ms748 KiB
#include "interactive.h" #include <set> #include <map> #include <iostream> using namespace std; int ans[110]; multiset<int> get(vector<int> v){ vector<int> kek = get_pairwise_xor(v); multiset<int> ms; for(int i = 0; i < kek.size(); i++){ ms.insert(kek[i]); } return ms; } vector<int> guess(int n) { ans[1] = ask(1); vector<int> pos[7]; for(int i = 2; i <= n; i++){ for(int j = 0; j < 7; j++){ if(((1 << j) & i) > 0){ pos[j].push_back(i); } } } vector<int> good[7]; for(int i = 0; i < 7; i++){ if(pos[i].size() == 0) continue; multiset<int> m1 = get(pos[i]); pos[i].push_back(1); multiset<int> m2 = get(pos[i]); m2.erase(m2.find(0)); for(auto it : m1){ m2.erase(m2.find(it)); } for(auto it : m2) { good[i].push_back((it ^ ans[1])); } } map<int, int> mp; for(int i = 0; i < 7; i++){ for(auto j : good[i]){ mp[j] |= (1 << i); } } for(int i = 0; i < 7; i++){ for(auto j : good[i]){ ans[mp[j]] = j; } } vector<int> lol; for(int i = 1; i <= n; i++){ lol.push_back(ans[i]); } return lol; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::multiset<int> get(std::vector<int>)':
Xoractive.cpp:13:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i = 0; i < kek.size(); i++){
      |                    ~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...