답안 #232309

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
232309 2020-05-16T15:29:09 Z Leonardo_Paes 앵무새 (IOI11_parrots) C++11
0 / 100
453 ms 892 KB
#include <bits/stdc++.h>
#include "encoder.h"
#include "encoderlib.h"

using namespace std;

void encode(int n , int m[] ){
    set<vector<int>> s;

    int qtd = 0;

    map<int, vector<int>> arr;

    for(int i=0; i<4; i++){
        for(int j=0; j<4; j++){
            for(int k=0; k<4; k++){
                for(int l=0; l<4; l++){
                    for(int m=0; m<4; m++){
                        for(int n=0; n<4; n++){
                            for(int o=0; o<4; o++){
                                for(int p=0; p<4; p++){
                                    for(int q=0; q<4; q++){
                                        for(int r=0; r<4; r++){
                                            vector<int> x;
                                            x.push_back(i);
                                            x.push_back(j);
                                            x.push_back(k);
                                            x.push_back(l);
                                            x.push_back(m);
                                            x.push_back(n);
                                            x.push_back(o);
                                            x.push_back(p);
                                            x.push_back(q);
                                            x.push_back(r);

                                            sort(x.begin(), x.end());

                                            if(s.find(x) == s.end()){
                                                qtd++;
                                                s.insert(x);
                                                arr[qtd] = x;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    for(int i=0; i<n; i++){
        int val = 0;
        for(int j=0; j<6; j++){
            if(m[i] & (1<<j)){
                val += (1<<(j+2));
            }
        }
        for(int j=0; j<10; j++){
            send(val + arr[val][j]);
        }
    }

}
#include <bits/stdc++.h>
#include "decoder.h"
#include "decoderlib.h"

using namespace std;

void decode(int n , int l, int m[] ){
    set<vector<int>> s;

    int qtd = 0;

    map<int, vector<int>> arr;
    map<vector<int>, int> ans;

    for(int i=0; i<4; i++){
        for(int j=0; j<4; j++){
            for(int k=0; k<4; k++){
                for(int l=0; l<4; l++){
                    for(int m=0; m<4; m++){
                        for(int n=0; n<4; n++){
                            for(int o=0; o<4; o++){
                                for(int p=0; p<4; p++){
                                    for(int q=0; q<4; q++){
                                        for(int r=0; r<4; r++){
                                            vector<int> x;
                                            x.push_back(i);
                                            x.push_back(j);
                                            x.push_back(k);
                                            x.push_back(l);
                                            x.push_back(m);
                                            x.push_back(n);
                                            x.push_back(o);
                                            x.push_back(p);
                                            x.push_back(q);
                                            x.push_back(r);

                                            sort(x.begin(), x.end());

                                            if(s.find(x) == s.end()){
                                                qtd++;
                                                s.insert(x);
                                                arr[qtd] = x;
                                                ans[x] = qtd;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    vector<int> x[65];

    for(int i=0; i<l; i++){
        int val = 0, pos = 0;
        for(int j=0; j<8; j++){
            if(j<2){
                val += m[i] & (1<<j);
            }
            else{
                pos += m[i] & (1<<j);
            }
        }
        x[pos].push_back(val);
    }

    for(int i=0; i<n; i++){
        sort(x[i].begin(), x[i].end());
        output(ans[x[i]]);
    }

}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 451 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 453 ms 892 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 453 ms 772 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 444 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 449 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 452 ms 832 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 449 ms 704 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 446 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 449 ms 704 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 449 ms 608 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 446 ms 760 KB Execution killed with signal 11 (could be triggered by violating memory limits)