| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 346788 | wwdd | Unscrambling a Messy Bug (IOI16_messy) | C++14 | 3 ms | 640 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
#include "messy.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
void det(int l, int r, int n, vi& pa, vi& res) {
if(l == r) {
res[pa[0]] = l;return;
}
string ref(n,'1');
for(int i=0;i<pa.size();i++) {
ref[pa[i]] = '0';
}
vi ls,rs;
for(int i=0;i<pa.size();i++) {
string qu = ref;
qu[pa[i]] = '1';
if(check_element(qu)) {
ls.push_back(pa[i]);
} else {
rs.push_back(pa[i]);
}
}
int m = (l+r)/2;
det(l,m,n,ls,res);
det(m+1,r,n,rs,res);
}
std::vector<int> restore_permutation(int n, int w, int r) {
int nb = 0;
while((1<<nb) < n) {
nb++;
}
for(int b=1;b<=nb;b++) {
int sz = (1<<b);
for(int i=0;i<n;i+=sz) {
for(int j=0;j<sz/2;j++) {
string ad;
ad.assign(n,'1');
for(int k=0;k<sz;k++) {
ad[i+k] = '0';
}
ad[i+j] = '1';
add_element(ad);
}
}
}
compile_set();
vi res(n,0);
vi par;
for(int i=0;i<n;i++) {
par.push_back(i);
}
det(0,n-1,n,par,res);
return res;
}
컴파일 시 표준 에러 (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... | ||||
