| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1244985 | Gabriel | Unscrambling a Messy Bug (IOI16_messy) | C++20 | 1 ms | 324 KiB | 
#include <bits/stdc++.h>
#include "messy.h"
using namespace std;
vector<int> restore_permutation(int n, int w, int r){
    string Primero = "01010101", Segundo = "00110011", Tercero = "00001111";
    vector<int> Retorno(8);
    if(n == 8){
        add_element(Primero);
        add_element(Segundo);
        add_element(Tercero);
        compile_set();
        if(check_element(Primero)){
            if(check_element(Segundo)){
                if(check_element(Tercero)){
                    for(int i = 0; i < 8; i++) Retorno[i] = i;
                    return Retorno;
                } else {
                    for(int i = 0; i < 8; i++){
                        for(int j = i + 1; j < 8; j++){
                            if(Tercero[i] == Tercero[j]) continue;
                            swap(Tercero[i], Tercero[j]);
                            if(check_element(Tercero)){
                                for(int k = 0; k < 8; k++){
                                    Retorno[k] = k;
                                    if(k == i) Retorno[k] = j;
                                    if(k == j) Retorno[k] = i;
                                }
                                return Retorno;
                            }
                            swap(Tercero[i], Tercero[j]);
                        }
                    }
                }
            } else {
                for(int i = 0; i < 8; i++){
                    for(int j = i + 1; j < 8; j++){
                        if(Segundo[i] == Segundo[j]) continue;
                        swap(Segundo[i], Segundo[j]);
                        if(check_element(Segundo)){
                            for(int k = 0; k < 8; k++){
                                Retorno[k] = k;
                                if(k == i) Retorno[k] = j;
                                if(k == j) Retorno[k] = i;
                            }
                            return Retorno;
                        }
                        swap(Segundo[i], Segundo[j]);
                    }
                }
            }
        } else {
            for(int i = 0; i < 8; i++){
                for(int j = 1; j < 8; j += 2){
                    swap(Primero[i], Primero[j]);
                    if(check_element(Primero)){
                        for(int k = 0; k < 8; k++){
                            Retorno[k] = k;
                            if(k == i) Retorno[k] = j;
                            if(k == j) Retorno[k] = i;
                        }
                        return Retorno;
                    }
                    swap(Primero[i], Primero[j]);
                }
            }
        }
    }
}
컴파일 시 표준 에러 (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... | ||||
