Submission #571858

# Submission time Handle Problem Language Result Execution time Memory
571858 2022-06-02T22:06:41 Z RandomLB Data Transfer (IOI19_transfer) C++17
0 / 100
9 ms 4348 KB
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
#define siz(x) (int)x.size()
 
vi get_attachment(vi v){
    int xr = 0;
  	vi res;
    for (int i = 0; i < siz(v); i++){
      	xr ^= (i+1)*v[i];
      	res.push_back(v[i]);
    }
    int on = 0;
    for (int i = 0; i < __lg(siz(v)+1); i++){
        res.push_back(xr&(1<<i)?1:0);
        if (xr&(1<<i)) on ^= 1;
    }
    res.push_back(on);
    return res;
}
 
vi retrieve(vi v){
    int n = (siz(v) < 100? 63 : 255);
    int xr = 0;
    vi res;
    for (int i = 0; i < n; i++){
        xr ^= (i+1)*v[i];
        res.push_back(v[i]);
    }
    int check = 0;
    for (int i = 0; i < __lg(n+1); i++) if (v[n+i]) check ^= (1<<i);
    //cout << xr << " " << check << "\n";
    if (xr != check && __builtin_popcount(check)%2 == v.back()) res[(xr^check)-1] ^= 1;
    return res;
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 900 KB WA in grader: wrong source retrieval
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 4348 KB WA in grader: wrong source retrieval
2 Halted 0 ms 0 KB -