# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23349 | youngyojun | Saveit (IOI10_saveit) | C++11 | 400 ms | 11256 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 "grader.h"
#include <vector>
#include <algorithm>
#include <queue>
#define pb push_back
#define sz(V) ((int)(V).size())
#define allv(V) ((V).begin()),((V).end())
using namespace std;
static const int huffswtd[3][3] = { {0, 1, 2}, {1, 0, 2}, {1, 2, 0} }; // [huffno][data]
static inline void fg(vector<int> G[], const int& A, const int& B) { G[A].pb(B); G[B].pb(A); }
static inline void callbit(const int& n, const int& k) {
for(int i = k-1; ~i; i--) encode_bit((n & (1<<i)) ? 1 : 0);
}
static inline void callhuffbit(const int& huffcode) {
if(0 == huffcode) encode_bit(1);
else if(1 == huffcode) { encode_bit(0); encode_bit(1); }
else { encode_bit(0); encode_bit(0); }
}
static vector<int> G[1005];
static int prt[1005], d[1005], sddt[1005];
static int cnt[3]; // -1, 0, 1
static int N, H;
static void dfs(const int& idx) {
for(int i = 0; i < sz(G[idx]); i++) {
if(~prt[G[idx][i]]) continue;
prt[G[idx][i]] = idx; dfs(G[idx][i]);
}
# | 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... |