| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1312617 | settop | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 1 ms | 352 KiB |
#include "messy.h"
#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
#define fall(i,a,b) for(int i=a;i<=b;i++)
#define rfall(i,a,b) for(int i=a;i>=b;i--)
#define pb push_back
#define sz(x) (int)x.size()
typedef pair<ll,ll> pii;
int rnd(int l,int r){
return l+rand()%(r-l+1);
}
std::vector<int> restore_permutation(int n, int w, int r){
srand(time(0));
string s="";
fall(i,0,n-1) s+="0";
fall(i,0,n-1){
s[i]='1';
add_element(s);
}
compile_set();
vector<int> p(n),z(n);
fall(i,0,n-1) s[i]='0';
int q=0;
fall(i,0,n-1){
vector<int> proc=z;
while(true){
int x=rnd(0,n-1);
if(proc[x]) continue;
proc[x]=1;
s[x]='1';
q++;
if(check_element(s)){
p[x]=i;
z[x]=1;
break;
}
s[x]='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... | ||||
