cp-library

競技プログラミング用 C++ ライブラリ

View the Project on GitHub qandori/cp-library

:heavy_check_mark: test/set_xor_min.test.cpp

test/set_xor_min.test.cpp · GitHub で見る

検証問題

依存ライブラリ

コード

#define PROBLEM "https://judge.yosupo.jp/problem/set_xor_min"
#include "data_structure/xor_set.hpp"
#include "components/fast_io_bulk.hpp"

int main() {
	FastInput input;
	FastOutput output;
	int q = 0;
	input.read(q);
	XorSet<> set;
	read_unsigned_records<2>(input, q, [&](std::uint32_t type, std::uint32_t x) {
		if (type == 0) set.insert(x);
		else if (type == 1) set.erase(x);
		else output.println(set.min_xor(x));
	});
}
Back to top page