C. Perfect Security time limit per test3.5 seconds memory limit per test512 megabytes inputstandard input outputstandard output Alice has a very important message M consisting of some non-negative integers that she wants to keep secret from Eve. Alic…
[codeforces 317]A. Perfect Pair 试题描述 Let us call a pair of integer numbers m-perfect, if at least one number in the pair is greater than or equal to m. Thus, the pairs (3, 3) and (0, 2) are 2-perfect while the pair (-1, 1) is not. Two integers x, y a…
传送门 01trie板子题. 给出两个数列,允许把第二个数列重新排列. 求使得两个数列每个位置对应的数的异或值和成为最小值的每个位置的异或和. 把第二个数列插入到01trie里面然后对于第一个数列中的数挨个询问最小异或和即可. 代码: #include<bits/stdc++.h> #define ri register int using namespace std; const int N=3e5+5,P=30; int n,son[N*30][2],siz[N*30],a[N],tot=…