제출 #1310908

#제출 시각아이디문제언어결과실행 시간메모리
1310908theiuliusData Transfer (IOI19_transfer)C++20
0 / 100
5 ms1720 KiB
#include "transfer.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define ll long long #define ff first #define ss second #define pb push_back using namespace std; std::vector<int> get_attachment(std::vector<int> a) { vector<int> v; int n = a.size(); for (int k = 5; k >= 0; k--){ int i = 0; int ans = 0; while (i < n){ for (int j = i; j < min(n, i + (1 << k)); j++){ ans ^= a[j]; } i += 2 * (1 << k); } v.pb(ans); } int ans = 0; for (int i = 0; i < n; i++){ ans ^= a[i]; } v.pb(ans); // for (auto h : v){ // cout << h; // } // cout << endl; return v; } std::vector<int> retrieve(std::vector<int> a) { int n = a.size() - 7; int K = 7; int ans0 = 0; for (int i = 0; i < n; i++){ // cout << a[i]; ans0 ^= a[i]; } // cout << endl; int l = 0, r = 63; for (int k = 5; k >= 0; k--){ int i = 0; int ans = 0; while (i < n){ for (int j = i; j < min(n, i + (1 << k)); j++){ ans ^= a[j]; } i += 2 * (1 << k); } // cout << l << " " << r << endl; if (a[n + (5 - k)] != ans){ // pirvel naxevarshia if (ans0 != a[n + K - 1]){ // n-shia corrupted r = (l + r) / 2; }else{ a.resize(n); return a; } }else{ // meore naxevarshia if (ans0 != a[n + K - 1]){ // n-shia corrupted l = (l + r + 1) / 2; } } } // cout << l << " " << r << endl; a[l] ^= 1; a.pop_back(); a.pop_back(); a.pop_back(); a.pop_back(); a.pop_back(); a.pop_back(); a.pop_back(); return a; // 011001010110110110100111110011010111111111111000101011100101001 // 011001010110110110100111110011010111111111111000101011100101001 }

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