제출 #412339

#제출 시각아이디문제언어결과실행 시간메모리
412339LouayFarah앵무새 (IOI11_parrots)C++14
81 / 100
5 ms1040 KiB
#include "bits/stdc++.h" #include "encoder.h" using namespace std; #define pb push_back void send(int a); void encode(int n, int m[]) { int nb = 0; for(int i = 0; i<n; i++) { string s = bitset<8>(m[i]).to_string(); for(int j = 7; j>=0; j--) { if(s[j]=='1') { send(nb); } nb++; } } }
#include "bits/stdc++.h" #include "decoder.h" using namespace std; #define pb push_back void output(int b); void decode(int n, int l, int x[]) { sort(x, x+l); int ptr = 0; for(int i = 0; i<n; i++) { int nb = 0; for(int j = 0; j<8; j++) { if(binary_search(x, x+l, ptr)) { int temp = 1; for(int k = 0; k<j; k++) temp*=2; nb+=temp; } ptr++; } output(nb); } }
#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...