# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1151195 | alexdd | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 1 ms | 328 KiB |
#include <vector>
#include "messy.h"
using namespace std;
std::vector<int> restore_permutation(int n, int w, int r)
{
for(int i=1;i<=n;i++)
{
string s="";
for(int j=0;j<i;j++)
s.push_back('1');
for(int j=0;j<n-i;j++)
s.push_back('0');
add_element(s);
}
compile_set();
string cur="";
for(int i=0;i<n;i++)
cur.push_back('0');
vector<int> brut(n);
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(cur[j]=='0')
{
cur[j]='1';
if(check_element(cur))
{
brut[j]=i;
break;
}
cur[j]='0';
}
}
}
return brut;
}
/*
4 16 16
2 1 3 0
*/
Compilation message (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... |