제출 #387420

#제출 시각아이디문제언어결과실행 시간메모리
387420Aldas25앵무새 (IOI11_parrots)C++14
34 / 100
3 ms1380 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define pb push_back #define f first #define s second void encode(int N, int M[]) { vector<pair<int, int>> toSend; int cnt = 0; FOR(i, 0, N-1) { int a = M[i] >> 4; int b = M[i] - (a<<4); toSend.pb({cnt++, a}); toSend.pb({cnt++, b}); } for (auto p : toSend) { send((p.f<<4) + p.s); } //for(i=0; i<N; i++) // send(M[i]); }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define pb push_back #define f first #define s second void decode(int N, int L, int X[]) { vector<pair<int, int>> seq; FOR(i, 0, L-1) { int a = X[i] >> 4; int b = X[i] - (a<<4); seq.pb({a,b}); } sort(seq.begin(), seq.end()); FOR(i, 0, N-1) { int a = seq[2*i].s; int b = seq[2*i+1].s; int rez = (a<<4) +b; output(rez); } }
#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...