제출 #414668

#제출 시각아이디문제언어결과실행 시간메모리
414668jeqcho앵무새 (IOI11_parrots)C++17
24 / 100
13 ms1332 KiB
#include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pair<int,int>> vpi; #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define F0R(i,a) FOR(i,0,a) #define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i) #define R0F(i,a) ROF(i,0,a) #define trav(a,x) for (auto& a: x) #define pb push_back #define rsz resize #define sz(x) int(x.size()) #define all(x) begin(x), end(x) #define fi first #define se second void encode(int N, int M[]) { vector<bool> mes(8*N); F0R(i,N) { F0R(j,8) { if(M[i]&(1<<j)) { mes[i*8+j]=1; } } } F0R(i,4*N) { bool f = mes[2*i]; bool s = mes[2*i+1]; int state=0; if(!f && !s) { state=0; } else if(f && !s) { state=1; } else if(!f && s) { state =2; } else { state=3; } F0R(j,state) { send(i); } } }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pair<int,int>> vpi; #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define F0R(i,a) FOR(i,0,a) #define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i) #define R0F(i,a) ROF(i,0,a) #define trav(a,x) for (auto& a: x) #define pb push_back #define rsz resize #define sz(x) int(x.size()) #define all(x) begin(x), end(x) #define fi first #define se second void decode(int N, int L, int X[]) { vi state(4*N); F0R(i,L) { int pos = X[i]; ++state[pos]; } vector<bool> mes(8*N); F0R(i,4*N) { bool f,s; if(state[i]==0) { f=0; s=0; } else if(state[i]==1) { f=1; s=0; } else if(state[i]==2) { f=0; s=1; } else { f=1; s=1; } mes[2*i]=f; mes[2*i+1]=s; } vi ans(N); F0R(i,N) { ans[i] = 0; F0R(j,8) { ans[i] += mes[8*i+j]<<j; } 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...