BZOJ_3110_[Zjoi2013]K大数查询_整体二分+树状数组 Description 有N个位置,M个操作.操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c 如果是2 a b c形式,表示询问从第a个位置到第b个位置,第C大的数是多少. Input 第一行N,M 接下来M行,每行形如1 a b c或2 a b c Output 输出每个询问的结果 Sample Input 2 5 1 1 2 1 1 1 2 2 2 1 1 2 2 1 1…
题目链接: K - Subarrays OR Gym - 102152K 题目大意:T组测试样例,然后n个数,让你求每一个l,r中有多少个不同的异或值. 具体思路: 对于(1,i)这个区间, 我们当前需要的信息是(1,i-1),(2.i-1),,,,(i-1.i-1)这个区间的信息,我们从第一个元素开始,将这些信息存储起来就好了,set去重. AC代码: #include<bits/stdc++.h> using namespace std; # define ll long long ; i…
K Best Time Limit: 8000MS Memory Limit: 65536K Total Submissions: 12812 Accepted: 3290 Case Time Limit: 2000MS Special Judge Description Demy has n jewels. Each of her jewels has some value vi and weight wi. Since her husband John got broke aft…
Dynamic Rankings Time Limit: 10 Seconds Memory Limit: 32768 KB The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find the k-th smallest number of the given N numbers. They…
3110: [Zjoi2013]K大数查询 Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 11654 Solved: 3505[Submit][Status][Discuss] Description 有N个位置,M个操作.操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c 如果是2 a b c形式,表示询问从第a个位置到第b个位置,第C大的数是多少. Input 第一行N,M 接下来M行,每行形如…
POJ3111 K Best,看讨论区说数据有点变态,精度要求较高,我就直接把循环写成了100次,6100ms过,(试了一下30,40都会wa,50是4000ms) 第一次在POJ上看到下面这种东西还是很好奇的, 一个题目可以接受多种正确答案,即有多组解的时候,题目就必须被Special Judge.Special Judge程序使用输入数据和一些其他信息来判答你程序的输出,并将判答结果返回. Case Time Limit: 2000MS Special Judge #include <c…
After the end of the truck drivers' strike, you and the rest of Nlogônia logistics specialists now have the task of planning the refueling of the gas stations in the city. For this, we collected information on stocks of R refineries and about the dem…
题目链接:http://codeforces.com/gym/100283/problem/F F. Bakkar In The Army time limit per test 2 seconds memory limit per test 256 megabytes input army.in output standard output Bakkar is now a senior college student studying computer science. And as many…