# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
189015 | PedroBigMan | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 4 ms | 1084 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include "messy.h"
using namespace std;
typedef int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=a; i<b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define INF 100000000000000000LL
ll insig;
#define In(vecBRO, LENBRO) REP(IBRO,0,LENBRO) {cin>>insig; vecBRO.pb(insig);}
void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
vector<int> restore_permutation(int n, int w, int r)
{
ll N=(ll) n;
ll b=(ll) log2(n);
vector<vector<string> > bits;
vector<string> xx; REP(i,0,b) {bits.pb(xx);}
ll curm=(1LL<<b); string base=""; REP(i,0,N) {base+="0";}
REP(i,0,b)
{
base[i]='1';
REP(j,b,N)
{
if((j%curm)<curm/2) {base[j]='1';bits[i].pb(base);base[j]='0';}
}
curm/=2;
base[i]='0';
}
REP(i,0,b)
{
base[i]='1';
add_element(base);
}
REP(i,0,b) {REP(j,0,bits[i].size()) {add_element(bits[i][j]);}}
compile_set();
vector<ll> p; REP(i,0,N) {p.pb(0LL);}
REP(i,0,N) {base[i]='0';}
vector<ll> indic;
REP(i,0,b)
{
REP(j,0,N)
{
if(find(indic.begin(),indic.end(),j)!=indic.end()) {continue;}
base[j]='1';
if(check_element(base))
{
indic.pb(j); break;
}
base[j]='0';
}
}
REP(i,0,N) {base[i]='0';}
REP(i,0,b) {p[indic[i]]=i;}
REP(i,0,N)
{
if(find(indic.begin(),indic.end(),i)!=indic.end()) {continue;}
base[i]='1';
REP(j,0,b)
{
base[indic[j]]='1';
if(!check_element(base))
{
p[i]+=(1LL<<(b-j-1));
}
base[indic[j]]='0';
}
base[i]='0';
}
return p;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |