Submission #781991

#TimeUsernameProblemLanguageResultExecution timeMemory
781991Dan4LifeData Transfer (IOI19_transfer)C++17
0 / 100
4 ms2488 KiB
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; #define sz(a) (int)a.size() vi get_attachment(vi v) { int x = 0, y = 0, m = sz(v)<99?6:8; vi ans; for(int i = 0; i < sz(v); i++) if(v[i]) x^=i+1; for(int i = 0; i < m; i++) ans.push_back((x>>i)&1), y^=ans.back(); ans.push_back(y); return ans; } vi retrieve(vi v){ int x = 0, xx = 0, y = 0, m = sz(v)<99?6:8, n=sz(v)<99?63:255; for(int i = 0; i < n; i++) if(v[i]) x^=i+1; for(int i = 0; i < m; i++) if(v[n+i]) xx^=1<<i, y^=1; if(v.back()==y and x!=xx) v[(x^xx)-1]^=1; return v; }

Compilation message (stderr)

transfer.cpp: In function 'vi retrieve(vi)':
transfer.cpp:18:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   18 |  if(v.back()==y and x!=xx) v[(x^xx)-1]^=1; return v;
      |  ^~
transfer.cpp:18:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   18 |  if(v.back()==y and x!=xx) v[(x^xx)-1]^=1; return v;
      |                                            ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...