제출 #524209

#제출 시각아이디문제언어결과실행 시간메모리
524209LoboUnscrambling a Messy Bug (IOI16_messy)C++17
0 / 100
2 ms332 KiB
#include "messy.h"
#include<bits/stdc++.h>
using namespace std;

const long long inf = (long long) 1e18 + 10;
const int inf1 = (int) 1e9 + 10;
// #define int long long
#define dbl long double
#define endl '\n'
#define sc second
#define fr first
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()

#define maxn 

vector<int> restore_permutation(int n, int w, int r) {
    vector<int> p1(n,0);

    for(int i = 1; i <= n; i++) {
        string s;
        for(int j = 0; j < i; j++) s.pb('1');
        for(int j = 0; j < n-i; j++) s.pb('0');

        add_element(s);
        cout << s << endl;
    }

    compile_set();
    string cur(n,'0');
    for(int i = 0; i < n; i++) {
        //encontrar qual j tem p[j] = i

        for(int j = 0; j < n; j++) {
            if(cur[j] == '1') continue;
            cur[j] = '1';
            bool ok;
            // cout << cur << " " << ok ? "false" : "true" << endl;
            ok = check_element(cur);
            // cout << cur << " " << ok ? "false" : "true" << endl;
            if(ok) {
                p1[j] = i;
                break;
            }
            cur[j] = '0';
        }
    }

    return p1;
}
#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...