Submission #1294400

#TimeUsernameProblemLanguageResultExecution timeMemory
1294400BlockOGData Transfer (IOI19_transfer)C++20
100 / 100
251 ms1740 KiB
#include <bits/stdc++.h>

// meeeooowwwww mrrowwww :3
// go play vivid/stasis!! now!!!! https://vividstasis.gay

#define fo(i, a, b) for (auto i = (a); i < (b); i++)
#define of(i, a, b) for (auto i = (b); i-- > (a);)
#define f first
#define s second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define be(a) a.begin(), a.end()
using namespace std;

int ____init = []{
    ios::sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    return 0;
}();

vector<int> get_attachment(vector<int> source) {
    vector<int> v = {0};
    for (int i : source) {
        while (__builtin_popcount(v.size()) == 1) v.pb(0);
        v.pb(i);
    }

    vector<int> res;
    for (int i = 1; i < v.size(); i *= 2) {
        int k = 0;
        fo(j, 0, v.size()) if (j & i) k ^= v[j];
        res.pb(k);
    }
    
    return res;
}

vector<int> retrieve(vector<int> data) {
    vector<int> v = {0};
    if (data.size() < 255) {
        int j = 63;
        fo(i, 0, 63) {
            while (__builtin_popcount(v.size()) == 1) v.pb(data[j++]);
            v.pb(data[i]);
        }
    } else {
        int j = 255;
        fo(i, 0, 255) {
            while (__builtin_popcount(v.size()) == 1) v.pb(data[j++]);
            v.pb(data[i]);
        }
    }

    int ci = 0;
    for (int i = 1; i < v.size(); i *= 2) {
        int k = 0;
        fo(j, 0, v.size()) if (j & i) k ^= v[j];
        ci |= i * k;
    }

    v[ci] ^= 1;

    vector<int> res;
    fo(i, 1, v.size()) if (__builtin_popcount(i) != 1) res.pb(v[i]);

    return res;
}

Compilation message (stderr)

grader.cpp: In instantiation of 'void shuffle(std::vector<T>&) [with T = Scenario]':
grader.cpp:200:10:   required from here
grader.cpp:28:23: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<Scenario*, vector<Scenario> >]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   28 |         random_shuffle(v.begin(), v.end());
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61,
                 from grader.cpp:8:
/usr/include/c++/13/bits/stl_algo.h:4581:5: note: declared here
 4581 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...