首页 > TAG信息列表 > Burgers

【Codeforces 1100F】Ivan and Burgers | 持久化线性基、扫描线

题目大意: 询问区间 [ L , R ] [L,R] [L,R]内子集异或第

CF1100F Ivan and Burgers

给定\(n\)和\(a_{1\cdots n}\),有\(q\)个询问,每个询问要求区间\([l,r]\)内选出任意个数的异或最大值。\((n,q\leq 5\times 10^5, a_i\leq 10^6)\) 不知道怎么就想到了分块。先按\(\sqrt n\)分块,预处理出\(f[l][r]\)表示第\(l\)个块到第\(r\)个块所有数的线性基,这个可以\(\mathcal

CF1100F Ivan and Burgers

链接 有点像 P1972 [SDOI2009]HH的项链? 将区间按 \(r\) 排序,对于在线性基中的每个元素,其在序列中的位置肯定是尽量靠右,所以插入时如果插入值与线性基在某一位上都为 \(1\),则比较其在序列中的位置,若插入值靠右则交换,继续插入。 #include<bits/stdc++.h> #define IL inline #define

There Are Two Types Of Burgers(greedy)

There are two types of burgers in your restaurant — hamburgers and chicken burgers! To assemble a hamburger you need two buns and a beef patty. To assemble a chicken burger you need two buns and a chicken cutlet. You have b buns, p beef patties and f

CodeForces 1100F Ivan and Burgers

CodeForces题面 Time limit 3000 ms Memory limit 262144 kB Source Codeforces Round #532 (Div. 2) Tags data structures divide and conquer greedy math *2600 Editorial Announcement #1 (en) Announcement #2 (ru) Tutorial #1 (en) Tutorial #2 (ru) Tutorial #3 (en

CF1100F Ivan and Burgers

CF1100F Ivan and Burgers 静态区间,选取任意个数使得它们的异或和最大 \(n,\ m\leq5\times10^5,\ a_i\in[0,\ 10^6]\) lxl ST表,线性基 如果暴力维护线性基,线段树时间复杂度为 \(O(n\log^2n)-O(\log^3n)\) 由于重复元素对答案没有影响,于是可以用ST表维护,时间复杂度为 \(O(n\log^3

Codeforces Round #532 (Div. 2)-F. Ivan and Burgers-线性基

Codeforces Round #532 (Div. 2)-F. Ivan and Burgers-线性基 【Description】 Ivan loves burgers and spending money. There are burger joints on the street where Ivan lives. Ivan has friends, and the -th friend suggested to meet at the joint li and walk to

codeforces 1100F Ivan and Burgers 线性基 离线

题目传送门 题意:   给出 n 个数,q次区间查询,每次查询,让你选择任意个下标为 [ l , r ] 区间内的任意数,使这些数异或起来最大,输出最大值。 思路:离线加线性基。 线性基学习博客1 线性基学习博客2 对于此题,先把区间按照 r 从小到大排序,然后依次处理这些区间,每次插入线性基时,优先保留下