Submission #1244036

#TimeUsernameProblemLanguageResultExecution timeMemory
1244036DedibeatUnscrambling a Messy Bug (IOI16_messy)C++20
20 / 100
1 ms328 KiB
#include "messy.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define F first 
#define S second 
#define all(x) (x).begin(), (x).end()
template<typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p)
{
    return os << "(" << p.F << "," << p.S << ")";
}
template<typename T> 
void print(const T &v, int lim = 1e9)
{
    for(auto x : v)
        if(lim-- > 0) cout << x << " ";
    cout << endl;
}
template<typename T>
void print(T *begin, const T *end)
{
    for(T *it = begin; it < end; it++)
        cout << *it << " ";
    cout << endl;
}
std::vector<int> restore_permutation(int n, int w, int r) {
    string s(n, '0');
    for(int i = 0; i < n; i++)
    {
        s[i] = '1';
        add_element(s);
    }
    compile_set();
    vector<int> ans(n);
    string t(n, '0');
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            if(t[j] == '1') continue;
            t[j] = '1';
            if(check_element(t))
            {
                ans[i] = j;
                break;
            }
            t[j] = '0';
        }
    }
    return ans;
}

Compilation message (stderr)

messy.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
messy_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...