제출 #934517

#제출 시각아이디문제언어결과실행 시간메모리
934517tmarcinkevicius앵무새 (IOI11_parrots)C++14
34 / 100
2 ms1316 KiB
#include<bits/stdc++.h> #include "encoder.h" #include "encoderlib.h" using namespace std; void encode(int N, int M[]) { for (int i = 0; i < N; i++) { bitset<16> number(M[i]); bitset<8> position(i); for (int i = 0; i < 8; i++) { number[8 + i] = position[i]; } send((int)number.to_ulong()); } }
#include<bits/stdc++.h> #include "decoder.h" #include "decoderlib.h" using namespace std; void decode(int N, int L, int X[]) { vector<int> ans(N); for (int i = 0; i < L; i++) { bitset<16> number(X[i]); bitset<8> num, pos; for (int i = 0; i < 8; i++) { pos[i] = number[8 + i]; num[i] = number[i]; } int position = (int)pos.to_ullong(); int theNum = (int)num.to_ullong(); ans[position] = theNum; } for (int i = 0; i < L; i++) { output(ans[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...