제출 #1302021

#제출 시각아이디문제언어결과실행 시간메모리
1302021vtnooUnscrambling a Messy Bug (IOI16_messy)C++20
38 / 100
1 ms504 KiB
#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((unsigned)chrono::steady_clock::now().time_since_epoch().count());
	vector<int>p(n),ret(n);
	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){
		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';
		}
	}
	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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...