제출 #1233572

#제출 시각아이디문제언어결과실행 시간메모리
1233572kaltspielerhyData Transfer (IOI19_transfer)C++20
40 / 100
35 ms1728 KiB
#include "transfer.h" #include <bits/stdc++.h> using namespace std; // avoir le full de 2 problèmes sans pouvoir les coder... int N = 255; vector<int> get_attachment(vector<int> source) { vector<int> res; int parite = 0; int position = 0; for (int i = 1; i <= N; i++) { if (source[i-1] == 1) { position ^= i; parite ^= 1; } } vector<int> binaire(8, 0); while (position != 0) { binaire[0]++; int idx = 0; while (binaire[idx] > 1) { binaire[idx] = 0; binaire[idx+1]++; idx++; } position--; } binaire.push_back(parite); return binaire; } vector<int> retrieve(vector<int> data) { int parite = 0; int position = 0; for (int i = N; i < N+8; i++) { if (data[i] == 1) { position += (1 << i-N); } } for (int i = 1; i <= N; i++) { if (data[i-1] == 1) { parite ^= 1; position ^= i; } } // vector<int> fz(data.begin(), data.begin()+N); // for (int i : fz) cerr << i << ' '; // cerr << '\n'; // cerr << position << '\n'; if (position == 0 || parite == data[N+8]) return vector<int>(data.begin(), data.begin()+N); data[position-1] ^= 1; vector<int> dd(data.begin(), data.begin()+N); // for (int i : dd) cerr << i << ' '; // cerr << '\n'; return vector<int>(data.begin(), data.begin()+N); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...