- 博客(10)
- 收藏
- 关注
原创 “玲珑杯”ACM比赛 Round #20 E -- 造物主的戒律(主席树)
给你一个序列,每次查询区间中小于等于x的所有数字里面第k1小的值以及大于x的所有数字里面第k2小的值,如果不存在,输出-1 每次输出两个数,对于每个数如果不存在,则单独输出-1 INPUT 第一行两个数n,m 第二行n个数表示序列a 后面m行每行五个数l,r,x,k1,k2 OUTPUT 对于每个查询输出答案 SAMPLE INPUT 5 5 1 2 3 4 5 1 5 3 1
2017-08-26 21:42:57 392
原创 HDU 6156 Palindrome Function(数位DP)
Palindrome FunctionTime Limit: 8000/4000 MS (Java/Others) Memory Limit: 256000/256000 K (Java/Others) Total Submission(s): 826 Accepted Submission(s): 452Problem Description As we all know,a pa
2017-08-21 22:31:28 288
原创 HDU Friend-Graph(离散数学)
Friend-GraphTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 611 Accepted Submission(s): 313Problem Description It is well known that small
2017-08-19 23:38:12 295
原创 2017"百度之星"程序设计大赛 - 复赛(1001,1003,1005)
Arithmetic of Bomb Accepts: 1050 Submissions: 1762 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description 众所周知,度度熊非常喜欢数字。 它最近在学习小学算术,第一次发现这个世界上居然
2017-08-18 16:48:08 620
原创 Codeforces Round #428 (Div. 2)(A+B)
A. Arya and Bran time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Bran and his older sister Arya are from the same house. Bran like candies
2017-08-13 11:08:30 374
转载 Codeforces Round #426 (Div. 1) B. The Bakery(dp+线段树)
B. The Bakery time limit per test2.5 seconds memory limit per test256 megabytes inputstandard input outputstandard outputSome time ago Slastyona the Sweetmaid decided to open her own bakery! She bo
2017-08-07 16:01:33 310
原创 玲珑杯1151 - Delivering parcels(主席树)
题目地址 题意:有2*n个物品均分给两个人,物品有两个属性w和v,求俩人物品中max(w)*max(v)的和。 题解: 将物品按w降序排序,则物品1一定属于第一组,枚举2—n,将它们分到第二组,然后枚举最大的v在第一组和第二组的情况,维护一个前缀最大可以减少使用query的次数。 代码:#include<bits/stdc++.h>using namespace std;typedef
2017-08-04 12:06:21 289
原创 玲珑杯 1149 - Buildings(二分+RMQ)
题目地址 题意:给你一个长度为n的序列,问有多少子区间满足max-min<=k. 题解:当l固定时,随着r的增大,max会变大,min会变小,则max-min有单调性,我们二分得到r的最大值,则贡献为r-l+1(最值可以通过RMQ得到)。 代码:#include<iostream>#include<stdio.h>#include<stdlib.h>#include<string.h>
2017-08-03 12:25:06 240
原创 Codeforces Round #427 (Div. 2) C. Star sky(前缀和)
C. Star sky time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The Cartesian coordinate system is set in the sky. There you can see n stars,
2017-08-03 00:42:29 441
原创 Codeforces Round #427 (Div. 2)(A+B)
A. Key races time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Two boys decided to compete in text typing on the site “Key races”. During the
2017-08-01 21:35:06 332
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人