Submission #1322035

#TimeUsernameProblemLanguageResultExecution timeMemory
1322035nubData Transfer (IOI19_transfer)C++20
100 / 100
28 ms1712 KiB
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define ld long double #define ci const int #define cll const long long #define cull const unsigned long long #define cd const double #define cld const long double #define fi first #define se second #define psb push_back #define ppb pop_back #define psf push_front #define ppf pop_front #define ps push #define pp pop #define all(x) x.begin(), x.end() #define popcount __builtin_popcountll #define ctz __builtin_ctzll #define clz __builtin_clzll using namespace std; mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); ll rand(ll l, ll r){ return uniform_int_distribution<ll>(l, r)(rng); } ci inf = 1e9; ci neginf = -1e9; cll inf_ll = 1e18; cll neginf_ll = -1e18; vector<int> playerAsmall(vector<int> v){ v.psb(0); for (int i=0; i<63; i++){ v[63] ^= v[i]; } vector<int> r; r.psb(v[63]); int t = 0; for (int i=0; i<64; i++){ if (v[i]) t ^= i; } for (int i=5; i>=0; i--){ r.psb((t>>i)&1); } return r; } vector<int> playerAbig(vector<int> v){ v.psb(0); for (int i=0; i<255; i++){ v[255] ^= v[i]; } vector<int> r; r.psb(v[255]); int t = 0; for (int i=0; i<256; i++){ if (v[i]) t ^= i; } for (int i=7; i>=0; i--){ r.psb((t>>i)&1); } return r; } vector<int> playerBsmall(vector<int> v){ int t = 0; for (int i=0; i<64; i++){ t ^= v[i]; } if (t == 0){ while (v.size() > 63){ v.ppb(); } return v; } int pos = 0; for (int i=64; i<=69; i++){ pos = pos*2 + v[i]; } for (int i=0; i<64; i++){ if (v[i]) pos ^= i; } v[pos] ^= 1; while (v.size() > 63){ v.ppb(); } return v; } vector<int> playerBbig(vector<int> v){ int t = 0; for (int i=0; i<256; i++){ t ^= v[i]; } if (t == 0){ while (v.size() > 255){ v.ppb(); } return v; } int pos = 0; for (int i=256; i<=263; i++){ pos = pos*2 + v[i]; } for (int i=0; i<256; i++){ if (v[i]) pos ^= i; } v[pos] ^= 1; while (v.size() > 255){ v.ppb(); } return v; } vector<int> get_attachment(vector<int> source){ if (source.size() == 63) return playerAsmall(source); else return playerAbig(source); } vector<int> retrieve(vector<int> data){ if (data.size() == 70) return playerBsmall(data); else return playerBbig(data); }

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...