# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1007906 | Faggi | Parrots (IOI11_parrots) | C++11 | 2 ms | 1488 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 <bits/stdc++.h>
using namespace std;
void encode(int N, int M[]){ int pos=0,par=0,cad=0,k,i,j, nK,ag=0,c,pot; vector<int>v(8,0); for(i=0; i<N; i++) { par=0; cad=0; k=0; ag=0; k=i; pot=1; for(j=0; j<8; j++) { if((M[i]&pot)>0) v[j]=1; else v[j]=0; pot*=2; } for(j=0; j<4; j++) { nK=k; nK=nK<<2; nK+=j; for(c=ag; c<ag+2; c++) { nK=nK<<1; if(v[c]==1) nK++; } send(nK); ag+=2; } pos++; }}
#include "decoder.h"
#include "decoderlib.h"
#include <bits/stdc++.h>
using namespace std;
void decode(int N, int L, int X[]){ int i,j,a,b,pos,par,num; vector<vector<vector<int>>>v(N,vector<vector<int>>(4,vector<int>(2,0))); for(i=0; i<L; i++) { a=0; b=0; pos=X[i]>>4; par=(X[i]^(pos<<4))>>2; if((X[i]&2)>0) a=1; if((X[i]&1)>0) b=1; v[pos][par][0]=a; v[pos][par][1]=b; } for(i=0; i<N; i++) { num=0; for(j=3; j>=0; j--) { a=v[i][j][0]; b=v[i][j][1]; num=num<<1; num+=b; num=num<<1; num+=a; } output(num); }}
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... |