This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "messy.h"
#define F first
#define S second
#define P push
#define pb push_back
#define MEM(dp,i) memset(dp,i,sizeof(dp))
#define W while
#define R return
#define C continue
#define SI size()
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define SF(x) scanf("%I64d",&x)
#define SF2(x,y) scanf("%I64d%I64d",&x,&y)
#define SF3(x,y,z) scanf("%I64d%I64d%I64d",&x,&y,&z)
#define SF4(x,y,z,o) scanf("%I64d%I64d%I64d%I64d",&x,&y,&z,&o)
#define all(v) v.begin(),v.end()
using namespace std;
const long long INF = 1e15;
const int MX=200015;
vector<int> v;
bool b[55];
vector<int> restore_permutation(int n, int w, int r) {
string s="";
for(int i=0;i<n;i++){
v.pb(i);
s+='0';
}
for(int i=0;i<n;i++){
s[i]='1';
add_element(s);
}
compile_set();
for(int i=0;i<n;i++)
s[i]='0';
for(int i=0;i<n;i++){
int p;
for(int j=0;j<n;j++){
if(b[j])C;
s[j]='1';
bool bol=check_element(s);
if(bol){
p=j;
break;
}
s[j]='0';
}
v[p]=i;
b[p]=1;
}
return v;
}
Compilation message (stderr)
messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:44:13: warning: 'p' may be used uninitialized in this function [-Wmaybe-uninitialized]
int p;
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |