제출 #1308921

#제출 시각아이디문제언어결과실행 시간메모리
1308921jungle15Data Transfer (IOI19_transfer)C++17
100 / 100
86 ms1728 KiB
#include "transfer.h" #include <vector> using namespace std; vector<int> get_attachment(vector<int> v) { int x = 0, y = 0; vector<int> a; for (int i = 0; i < v.size(); ++i) if (v[i]) x ^= i + 1; for (int i = 0; i < __lg(v.size() + 1); ++i) a.push_back((x >> i) & 1), y ^= (x >> i) & 1; a.push_back(y); return a; } vector<int> retrieve(vector<int> v) { int x = 0, xx = 0, y = 0, n = v.size() < 99 ? 63 : 255; for (int i = 0; i < n; ++i) if (v[i]) x ^= i + 1; for (int i = 0; i < __lg(n + 1); ++i) if (v[n + i]) xx ^= 1 << i, y ^= 1; if (v.back() == y && x != xx) v[(x ^ xx) - 1] ^= 1; return vector<int>(v.begin(), v.begin() + n); }

컴파일 시 표준 에러 (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...