
思维
UCAS王小二
不念过去,不畏未来...
展开
-
Codeforces777C 技巧
C. Alyona and SpreadsheetDuring the lesson small girl Alyona works with one famous spreadsheet computer program and learns how to edit tables.Now she has a table filled with integers.原创 2017-04-26 07:41:08 · 1453 阅读 · 0 评论 -
牛客练习赛14 B 区间的连续段【ST表+倍增】
链接:https://www.nowcoder.com/acm/contest/82/B 来源:牛客网 题目描述 给你一个长为n的序列a和一个常数k 有m次询问,每次查询一个区间[l,r]内所有数最少分成多少个连续段,使得每段的和都 <= k 如果这一次查询无解,输出”Chtholly” 输入描述: 第一行三个数n,m,k 第二行n个数...原创 2018-04-02 21:54:21 · 226 阅读 · 0 评论 -
长安大学第三届ACM-ICPC程序设计竞赛【A E L】
A Unpredictable Accidents 链接:https://www.nowcoder.com/acm/contest/102/A 来源:牛客网 题目描述 Due to unpredictable accidents, The Third Chang′an University ACM−ICPC Programming Competition will be...原创 2018-04-14 21:30:23 · 484 阅读 · 1 评论 -
牛客练习赛13 A B C F【二分+思维】
链接:https://www.nowcoder.com/acm/contest/70/A 来源:牛客网 题目描述 定义一个数字为幸运数字当且仅当它的所有数位都是4或者7。 比如说,47、744、4都是幸运数字而5、17、467都不是。 现在,给定一个字符串s,请求出一个字符串,使得: 1、它所代表的整数是一个幸运数字; 2、它非空; 3、它作...原创 2018-03-21 18:01:47 · 286 阅读 · 0 评论 -
CodeForces - 828D High Load【构造+图】
Arkady needs your help again! This time he decided to build his own high-speed Internet exchange point. It should consist of n nodes connected with minimum possible number of wires into one network (a...原创 2018-03-16 09:57:03 · 303 阅读 · 0 评论 -
Codeforces Round #462 (Div. 2)
A. A Compatible Pair Nian is a monster which lives deep in the oceans. Once a year, it shows up on the land, devouring livestock and even people. In order to keep the monster away, people fill the...原创 2018-02-17 22:08:43 · 245 阅读 · 0 评论 -
“玲珑杯”ACM比赛 Round #23
A – 生是脂肪的人 分析:打表找规律;#include #include #include using namespace std;typedef long long LL;const int maxn = 1010;double x[maxn], y[maxn];int main() { int t; scanf("%d", &t); w原创 2017-12-30 22:15:30 · 192 阅读 · 0 评论 -
Codeforces 620E New Year Tree【DFS序+线段树区间染色+二进制思维+位运算】
The New Year holidays are over, but Resha doesn’t want to throw away the New Year tree. He invited his best friends Kerim and Gural to help him to redecorate the New Year tree. The New Year tree is原创 2018-02-01 23:56:42 · 317 阅读 · 0 评论 -
hdu 4578 Transformation【线段树区间&思维】
Problem Description Yuanfang is puzzled with the question below: There are n integers, a1, a2, …, an. The initial values of them are 0. There are four kinds of operations. Operation 1: Add c原创 2018-01-31 14:41:50 · 356 阅读 · 0 评论 -
HDU 5773 The All-purpose Zero【LIS变形】
Problem Description ?? gets an sequence S with n intergers(0 < n <= 100000,0<= S[i] <= 1000000).?? has a magic so that he can change 0 to any interger(He does not need to change all 0 to the same inte原创 2017-08-10 17:14:28 · 608 阅读 · 0 评论 -
输入输出外挂模板
对于输入数据比较多的情况下,输入输出外挂可以节省不少时间。大神开挂过题博客这是一个多个数相加,介绍一下输入输出外挂模板;#include#include#includeusing namespace std;int Scan() //输入外挂{ int res=0,ch,flag=0; if((ch=getchar())=='-') fl原创 2017-07-23 08:52:36 · 561 阅读 · 0 评论 -
玲珑杯1143 - 计算几何你瞎暴力怕【思维】
DESCRIPTION今天HHHH考完了期末考试,他在教学楼里闲逛,他看着教学楼里一间间的教室,于是开始思考:如果从一个坐标为 (x1,y1,z1)(x1,y1,z1)的教室走到(x2,y2,z2)(x2,y2,z2)的距离为|x1−x2|+|y1−y2|+|z1−z2||x1−x2|+|y1−y2|+|z1−z2|那么有多少对教室之间的距离是不超过RR的呢?原创 2017-07-15 23:52:44 · 424 阅读 · 0 评论 -
H - Sorted Arrays AtCoder - 2367
Problem StatementYou are given an array A of length N. Your task is to divide it into several contiguous subarrays. Here, all subarrays obtained must be sorted in either non-decreasing or non-incr原创 2017-05-29 19:54:03 · 470 阅读 · 0 评论 -
1338: 紧张的考试周 [技巧]
OJ目前支持C/C++、Java、Pascal语言。1338: 紧张的考试周 [思维]时间限制: 1 Sec 内存限制: 128 MB题目描述马上要到考试周了,王炸发现自己平时光顾着去网吧学ACM了,功课还真没怎么复习。抛开数据结构这种送分的课程,还有一些例如大物、概率论这种费时费力的课程。王炸决定花上一些时间开始复习了。根据考试安排,王炸发现自己有n门功课原创 2017-04-26 07:52:19 · 509 阅读 · 0 评论 -
HDU 6411 带劲的and和【枚举贡献】
HDU 6411 带劲的and和; 分析:写了好久了,突然想补一下博客。。。 公式看完过后,就是求一个联通图内任意两点之间的max(vi,vj)×(vi&amp;vj)。直观感受是n*n的做法,从枚举贡献的角度出发。对于任意的vi,它所带来的贡献是:1,比它小的vj的max(vi,vj)=vi,(vi&amp;vj)=排序后的二进制累加和;2,比它小的vj的max(vi,vj)=vj,对应的v...原创 2018-09-04 13:39:30 · 262 阅读 · 0 评论