제출 #994551

#제출 시각아이디문제언어결과실행 시간메모리
994551efishel앵무새 (IOI11_parrots)C++17
81 / 100
3 ms1416 KiB
// ~15 mins dentro del contest #include "encoder.h" #include "encoderlib.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector <ll>; void encode (int n, int m[]) { vll ve(m, m+n); vector <pair <ll, ll> > th; for (ll i = 0; i < n; i++) { for (ll bit = 0; bit < 8; bit++) { if (ve[i]>>bit&1) { th.push_back({ i, bit }); } } } vll ans; for (auto [i, bit] : th) { ans.push_back(i<<3|bit); } for (ll i : ans) send(i); }
#include "decoder.h" #include "decoderlib.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector <ll>; void decode (int n, int l, int x[]) { vll ve(x, x+l); vll ans(n, 0); for (ll num : ve) { ll i = num>>3; ll bit = num&0b111; ans[i] |= 1<<bit; } for (ll i : ans) output(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...