| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1360607 | NValchanov | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 1 ms | 344 KiB |
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;
string vector_to_string(vector < bool > v)
{
string result = "";
for(int i = 0; i < v.size(); i++)
{
result += (char)(v[i] + '0');
}
return result;
}
vector < int > restore_permutation(int n, int w, int r)
{
vector < bool > mask(n, 0);
for(int i = 0; i < n; i++)
{
mask[i] = 1;
string t = vector_to_string(mask);
add_element(t);
}
for(int i = 0; i < n; i++)
{
mask[i] = 0;
}
compile_set();
vector < int > p(n);
vector < int > ord(n);
for(int i = 0; i < n; i++)
{
ord[i] = i;
}
mt19937 g(time(nullptr));
shuffle(ord.begin(), ord.end(), g);
for(int i = 0; i < n; i++)
{
for(int j : ord)
{
if(mask[j])
continue;
mask[j] = 1;
string t = vector_to_string(mask);
if(check_element(t))
{
p[j] = i;
break;
}
mask[j] = 0;
}
}
return p;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
