Submission #568824

#TimeUsernameProblemLanguageResultExecution timeMemory
568824NemanjaSo2005Unscrambling a Messy Bug (IOI16_messy)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "messy.h" #define ll long long using namespace std; string str; int koji[130]; bool lock[130]; vector<int> ret; vector<int> restore_permutation(int N, int w, int r) { for(int i=1;i<=N;i++) str.push_back('0'); for(int i=0;i<N-1;i++){ str[i]='1'; add_element(str); } compile_set(); for(int i=0;i<N;i++){ str[i]='0'; koji[i]=-1; } for(int i=0;i<N-1;i++){ for(int j=0;j<N;j++){ if(j!=0){ if(lock[j-1]==false) str[j-1]='0'; } if(lock[j]) continue; str[j]='1'; if(check_element(str)){ // cout<<"IMA GA"<<endl; koji[j]=i; lock[j]=true; break; } } } for(int i=0;i<N;i++) if(koji[i]==-1) koji[i]=N-1; for(int i=0;i<N;i++) ret.push_back(koji[i]); return ret; }

Compilation message (stderr)

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:24:16: error: reference to 'lock' is ambiguous
   24 |             if(lock[j-1]==false)
      |                ^~~~
In file included from /usr/include/c++/10/future:38,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:105,
                 from messy.cpp:1:
/usr/include/c++/10/mutex:589:5: note: candidates are: 'template<class _L1, class _L2, class ... _L3> void std::lock(_L1&, _L2&, _L3& ...)'
  589 |     lock(_L1& __l1, _L2& __l2, _L3&... __l3)
      |     ^~~~
messy.cpp:7:6: note:                 'bool lock [130]'
    7 | bool lock[130];
      |      ^~~~
messy.cpp:27:13: error: reference to 'lock' is ambiguous
   27 |          if(lock[j])
      |             ^~~~
In file included from /usr/include/c++/10/future:38,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:105,
                 from messy.cpp:1:
/usr/include/c++/10/mutex:589:5: note: candidates are: 'template<class _L1, class _L2, class ... _L3> void std::lock(_L1&, _L2&, _L3& ...)'
  589 |     lock(_L1& __l1, _L2& __l2, _L3&... __l3)
      |     ^~~~
messy.cpp:7:6: note:                 'bool lock [130]'
    7 | bool lock[130];
      |      ^~~~
messy.cpp:33:13: error: reference to 'lock' is ambiguous
   33 |             lock[j]=true;
      |             ^~~~
In file included from /usr/include/c++/10/future:38,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:105,
                 from messy.cpp:1:
/usr/include/c++/10/mutex:589:5: note: candidates are: 'template<class _L1, class _L2, class ... _L3> void std::lock(_L1&, _L2&, _L3& ...)'
  589 |     lock(_L1& __l1, _L2& __l2, _L3&... __l3)
      |     ^~~~
messy.cpp:7:6: note:                 'bool lock [130]'
    7 | bool lock[130];
      |      ^~~~