Submission #345516

#TimeUsernameProblemLanguageResultExecution timeMemory
345516mat_vXoractive (IZhO19_xoractive)C++14
0 / 100
5 ms896 KiB
#include <bits/stdc++.h> #include "interactive.h" #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/rope> #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i)) #define fb(i,a,b) for(int (i) = (a); (i) >= (b); --(i)) #define mod 998244353 #define xx first #define yy second #define all(a) (a).begin(), (a).end() #define pb push_back #define ll long long #define pii pair<int,int> using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>,rb_tree_tag, tree_order_statistics_node_update> ordered_set;/// find_by_order(x)(x+1th) , order_of_key() (strictly less) mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); vector<int> ans; vector<int> up1; vector<int> up2; map<int,int> poj; map<int,int> skup; vector<int> svi; vector<int> guess(int n){ ff(i,0,n - 1)ans.pb(0); ans[0] = ask(1); ff(i,0,6){ up1.clear(); up2.clear(); ff(j,2,n){ if(j&(1<<i)){ up1.pb(j); up2.pb(j); } } up2.pb(1); vector<int> imap = get_pairwise_xor(up1); vector<int> imad = get_pairwise_xor(up2); poj.clear(); for(auto c:imad)poj[c]++; for(auto c:imap)poj[c]--; poj[0]--; for(auto c:imad){ if(poj[c] > 0){ svi.pb(ans[0]^c); skup[ans[0]^c] += (1<<i); } } } for(auto c:svi){ ans[skup[c] - 1] = c; } return ans; }

Compilation message (stderr)

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:7:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    7 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:33:5: note: in expansion of macro 'ff'
   33 |     ff(i,0,n - 1)ans.pb(0);
      |     ^~
Xoractive.cpp:7:27: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
    7 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:35:5: note: in expansion of macro 'ff'
   35 |     ff(i,0,6){
      |     ^~
Xoractive.cpp:7:27: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
    7 | #define ff(i,a,b) for(int (i) = (a); (i) <= (b); ++(i))
      |                           ^
Xoractive.cpp:38:9: note: in expansion of macro 'ff'
   38 |         ff(j,2,n){
      |         ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...