daylight-library

This documentation is automatically generated by competitive-verifier/competitive-verifier

View the Project on GitHub daylight-pro/daylight-library

:warning: daylight/compress.hpp

Depends on

Code

#pragma once
#include "daylight/base.hpp"
template<typename T>
struct Compress {
private:
	map<T, int> table;
	vector<T> V;
	bool has_built;

public:
	Compress(): has_built(false) {
	}

	void add(const T x) {
		assert(!has_built);
		V.push_back(x);
	}
	void add(const vector<T> &x) {
		assert(!has_built);
		for(auto v: x) {
			V.push_back(v);
		}
	}
	void build() {
		int ind = 0;
		so(V);
		uni(V);
		for(auto v: V) {
			table[v] = ind;
			ind++;
		}
		has_built = true;
	}
	int get(T x) {
		assert(has_built);
		return table[x];
	}
	T operator[](int i) {
		return V[i];
	}
	size_t size() {
		return V.size();
	}
};
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj_resolve/resolver.py", line 181, in resolve
    bundled_code = language.bundle(path, basedir=basedir)
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 252, in bundle
    bundler.update(path)
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 482, in update
    self.update(
  File "/home/runner/.local/lib/python3.10/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 477, in update
    raise BundleErrorAt(
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: daylight/base.hpp: line 103: unable to process #include in #if / #ifdef / #ifndef other than include guards
Back to top page