제출 #1308916

#제출 시각아이디문제언어결과실행 시간메모리
1308916thnhannData Transfer (IOI19_transfer)C++20
컴파일 에러
0 ms0 KiB
#include transfer.h #include <bits/stdc++.h> using namespace std; vector<int> get_attachment(vector<int> source) { vector<int>bit; int total = 0; for(int i=0;i<=255;i++) if(source[i]) total = total ^ (i + 1); for(int i=0;i<6;i++) if((total >> i)&1) bit.push_back(1); else bit.push_back(0); total = 0; for(int i=0;i<6;i++) if(bit[i] == 1) total = total ^ (i + 1); for(int i=0;i<3;i++) if((total >> i)&1) bit.push_back(1); else bit.push_back(0); return bit; } vector<int> retrieve(vector<int> data) { int total1 = 0; int val2=0; int total2 = 0; int val3 = 0; vector<int>ans; for(int i=0;i<=255;i++) if(data[i] == 1) total1 ^= (i + 1); for(int i=256;i<=256 + 6 - 1;i++) if(data[i] == 1) total2 ^= (i - 255); for(int i=256;i<=256 + 6 - 1;i++) if(data[i] == 1) val2 ^= (1<<(i-256)); for(int i=256 + 6;i<=256 + 9 - 1;i++) if(data[i] == 1) val3 ^= (1<<(i-256-6)); for(int i=0;i<=255;i++) ans.push_back(data[i]); if(val3 == total2 && total1 != val2) { int pos = total1 ^ val2; ans[pos - 1] = (ans[pos - 1]^1); total1 = val2; } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

transfer.cpp:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include transfer.h
      |          ^~~~~~~~
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)
      |     ^~~~~~~~~~~~~~