Submission #1121908

#TimeUsernameProblemLanguageResultExecution timeMemory
1121908MoonnUnscrambling a Messy Bug (IOI16_messy)C++17
Compilation error
0 ms0 KiB
#include "messy.h" #include <bits/stdc++.h> #define ll long long #define endl "\n"; #define AI ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std; vector<ll>restore_permutation(ll n,ll w,ll r) { vector<string>q; string a="1"; q.push_back(a); for(ll i=1;i<n;i++) a+="0"; for(ll i=0;i<n;i++) { a[i]='1'; q.push_back(a); } for(ll i=0;i<n;i++) add_element(q[i]); compile_set(); vector<permu>pp(n); a=q[0]; for(ll i=0;i<n;i++) { a[i]='0'; for(ll j=0;j<n;j++) { a[j]='1'; if(check_element(a)) { pp[i]=j; break; } } } return pp; }

Compilation message (stderr)

messy.cpp: In function 'std::vector<long long int> restore_permutation(long long int, long long int, long long int)':
messy.cpp:22:12: error: 'permu' was not declared in this scope
   22 |     vector<permu>pp(n);
      |            ^~~~~
messy.cpp:22:17: error: template argument 1 is invalid
   22 |     vector<permu>pp(n);
      |                 ^
messy.cpp:22:17: error: template argument 2 is invalid
messy.cpp:32:18: error: invalid types 'int[long long int]' for array subscript
   32 |                pp[i]=j;
      |                  ^
messy.cpp:37:12: error: could not convert 'pp' from 'int' to 'std::vector<long long int>'
   37 |     return pp;
      |            ^~
      |            |
      |            int