Submission #1308913

#TimeUsernameProblemLanguageResultExecution timeMemory
1308913sweetwibu2k8Data Transfer (IOI19_transfer)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "transfer.h" using namespace std; #define endl "\n" #define fi first #define se second #define pb push_back #define p_q priority_queue #define bit(n, i) (((n)>>(i))&1) #define all(x) x.begin(), x.end() typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,int> pli; typedef vector <vector <int> > vvi; const int M = 1e6 + 6; const int mod = 1e9 + 7; const int inf = 1e9 + 7; void maximize (int &a, int b) { if (a < b) a = b; } void minimize (int &a, int b) { if (a > b) a = b; } void add (int &a, int b) { a += b; if (a >= mod) a -= mod; } void del (int &a, int b) { a -= b; if (a < 0) a += mod; } vector <int> get_attachment (vector <int> source) { int T = 0, n = source.size(); for (int i = 0; i < n; i ++) if (source[i] == 1) T ^= i; vector <int> res; int limit = ((n < 255) ? 6 : 8); for (int i = 0; i < limit; i ++) res.pb (bit (T, i)); res.pb (__builtin_popcount (T) & 1); return res; } vector <int> retrieve (vector <int> data) { int n = data.size(), T = 0; int limit = ((n < 255) ? 6 : 8); n = n - limit - 1; for (int i = 0; i < n; i ++) if (data[i] == 1) T ^= i; int tmp = 0; for (int i = n; i <

Compilation message (stderr)

transfer.cpp: In function 'std::vector<int> retrieve(std::vector<int>)':
transfer.cpp:48:28: error: expected primary-expression at end of input
   48 |         for (int i = n; i <
      |                            ^
transfer.cpp:48:28: error: expected ';' at end of input
   48 |         for (int i = n; i <
      |                            ^
      |                            ;
transfer.cpp:48:28: error: expected primary-expression at end of input
transfer.cpp:48:28: error: expected ')' at end of input
   48 |         for (int i = n; i <
      |             ~              ^
      |                            )
transfer.cpp:48:28: error: expected statement at end of input
transfer.cpp:48:28: error: expected '}' at end of input
transfer.cpp:41:1: note: to match this '{'
   41 | {
      | ^
transfer.cpp:48:28: warning: no return statement in function returning non-void [-Wreturn-type]
   48 |         for (int i = n; i <
      |                            ^
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)
      |     ^~~~~~~~~~~~~~