Submission #536909

#TimeUsernameProblemLanguageResultExecution timeMemory
536909DJ035Unscrambling a Messy Bug (IOI16_messy)C++17
Compilation error
0 ms0 KiB
#include "messy.h" #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #include <bits/stdc++.h> #define MEM 222 #define sanic ios_base::sync_with_stdio(0) #define x first #define y second #define pf push_front #define pb push_back #define all(v) v.begin(), v.end() #define sz size() using namespace std; typedef long long ll; typedef pair<ll, ll> pi; const ll INF = 1e17+7; const ll MOD = 998244353; ll gcd(ll a, ll b){ if(a%b) return gcd(b, a%b); return b; } int N; vector<int> ans; void ins(int l, int r) { if(r-l==1) return; string s(N, '0'); int mid=l+r>>1; for(int i=l; i<r; i++) s[i] = '1'; for(int i=l; i<mid; i++) { s[i] = '0'; add_element(s); s[i] = '1'; } ins(l, mid); ins(mid, r); } void hwak(vector<int> a, int k) { if(a.sz()==1) { ans[a[0]] = k; return; } vector<int> l, r; string s(N,'0'); for(int i:a) s[i] = '1'; for(int i:a) { s[i] = '0'; if(check_element(s)) l.push_back(i); else r.push_back(i); s[i] = '1'; } hwak(l, k); hwak(r, k+r.size()); } std::vector<int> restore_permutation(int n, int w, int r) { vector<int> im; ans.resize(n); N = n; ins(0, n); compile_set(); for(int i=0; i<n; i++) im.push_back(i); hwak(im, 0); return ans; }

Compilation message (stderr)

messy.cpp: In function 'void ins(int, int)':
messy.cpp:29:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   29 |     int mid=l+r>>1;
      |             ~^~
messy.cpp: In function 'void hwak(std::vector<int>, int)':
messy.cpp:42:13: error: expression cannot be used as a function
   42 |     if(a.sz()==1) {
      |             ^