# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
704324 | bin9638 | Parrots (IOI11_parrots) | C++17 | 0 ms | 0 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.
#ifndef SKY
#include "encoder.h"
#include "encoderlib.h"
#endif // SKY
#include <bits/stdc++.h>
using namespace std;
#ifdef SKY
vector<int> tokens;
void send(int x) {
tokens.push_back(x);
}
#endif // SKY
void encode(int N, int M[])
{
for(int i=0;i<N;i++)
send((i<<8)+M[i]);
}
#ifdef SKY
int main(void) {
freopen("ENCODE.inp","r",stdin);
freopen("ENCODE.out","w",stdout);
srand(time(0));
int n; cin >> n;
int a[n];
for (int i = 0; i < n; i++) cin >> a[i];
encode(n, a);
cout << n << endl;
cout << tokens.size() << endl;
for (int x : tokens) cout << x << " " ; cout << endl;
return 0;
}
#endif // SKY
#ifndef SKY
#include "encoder.h"
#include "encoderlib.h"
#endif // SKY
#include <bits/stdc++.h>
using namespace std;
#ifdef SKY
vector<int> tokens;
void output(int b) {
cout<<b<<" ";
}
#endif // SKY
void decode(int n, int l,int X[])
{
int kq[n];
for(int i=0; i<l; i++)
kq[X[i]>>8]=(X[i]&((1<<8)-1));
for(int i=0;i<n;i++)
output(kq[i]);
}
#ifdef SKY
int main(void) {
freopen("DECODE.inp","r",stdin);
freopen("DECODE.out","w",stdout);
int n,l;
cin>>n>>l;
int a[l];
for(int i=0;i<l;i++)
cin>>a[i];
decode(n,l,a);
return 0;
}
#endif // SKY