제출 #232309

#제출 시각아이디문제언어결과실행 시간메모리
232309Leonardo_Paes앵무새 (IOI11_parrots)C++11
0 / 100
453 ms892 KiB
#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]]); } }
#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...