Submission #781991

# Submission time Handle Problem Language Result Execution time Memory
781991 2023-07-13T14:36:11 Z Dan4Life Data Transfer (IOI19_transfer) C++17
0 / 100
4 ms 2488 KB
#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

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 time Memory Grader output
1 Incorrect 3 ms 744 KB WA in grader: wrong source retrieval
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 2488 KB WA in grader: wrong source retrieval
2 Halted 0 ms 0 KB -