#include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,pao=b;i<pao;++i)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;
void add_element(std::string x);
bool check_element(std::string x);
void compile_set();
std::vector<int> restore_permutation(int n, int w, int r){
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
vector<int>p(n),ret(n,-1);
fore(i,0,n)p[i]=i;
shuffle(ALL(p),rng);
string s(n,'0');
fore(i,0,n){
s[i]='1';
add_element(s);
}
compile_set();
string c(n,'0');
vector<bool>listo(n,0);
fore(i,0,n-1){
fore(j,0,n){
if(listo[p[j]])continue;
c[p[j]]='1';
if(check_element(c)){
listo[p[j]]=1;
ret[p[j]]=i;
break;
}
c[p[j]]='0';
}
}
fore(i,0,n){
if(ret[i]==-1)ret[i]=n-1;
}
return ret;
}
컴파일 시 표준 에러 (stderr) 메시지
messy.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
messy_c.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~| # | 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... |