# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
248521 | A02 | Parrots (IOI11_parrots) | C++14 | 3 ms | 1536 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "encoder.h"
#include "encoderlib.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <utility>
#include <string>
using namespace std;
void encode(int N, int M[])
{
vector<bool> message;
for(int i = 0; i < N; i++){
for (int j = 7; j >= 0; j--){
message.push_back((M[i] & (1 << j)));
}
}
for (int i = 0; i < N; i++){
cout << M[i] << ' ';
}
cout << endl;
for (int i = 0; i < message.size(); i++){
cout << message[i] << ' ';;
}
cout << endl;
for (int i = 0; i < 4 * N; i++){
send((4 * i + 2 * message[2 * i] + message[2 * i + 1]));
}
}
#include "decoder.h"
#include "decoderlib.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <utility>
using namespace std;
//bool pairc
void decode(int N, int L, int X[])
{
vector<pair<int, int> > recieved;
vector<int> full_recieved;
for(int i=0; i<L; i++) {
recieved.push_back(make_pair(X[i] >> 2, X[i] & 3));
}
sort(recieved.begin(), recieved.end());
for (int i = 0; i < recieved.size(); i++){
//cout << recieved[i].first << " : " << recieved[i].second << endl;
full_recieved.push_back(recieved[i].second);
cout << 'r' << recieved[i].second << endl;
}
for (int i = 0; i < N; i++){
output(((full_recieved[4 * i] << 6) + (full_recieved[4 * i + 1] << 4) + (full_recieved[4 * i + 2] << 2) + (full_recieved[4 * i + 3])));
}
}
Compilation message (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... |