- 博客(20)
- 资源 (4)
- 收藏
- 关注
原创 线段树入门
线段树入门(Segment Tree)开学要给萌新们讲课,懒得写PPT于是跑来写博客。 线段树引入 题目描述: 已知一个数列,你需要进行下面两种操作: 1.将某区间每一个数加上x 2.求出某区间每一个数的和 输入格式: 第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。 第二行包含N个用空格分隔的整数,其中第i个...
2018-08-29 19:36:52
292
原创 2018年全国多校算法寒假训练营练习比赛(第五场)解题报告
A-逆序数https://www.nowcoder.com/acm/contest/77/A题目描述 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序的总数就称为这个排列的逆序数。比如一个序列为4 5 1 3 2, 那么这个序列的逆序数为7,逆序对分别为(4, 1), (4, 3), (4, 2), (5, 1),...
2018-02-26 14:51:59
1173
原创 2018年全国多校算法寒假训练营练习比赛(第四场)解题报告
A-石油采集题目描述随着海上运输石油泄漏的问题,一个新的有利可图的行业正在诞生,那就是撇油行业。如今,在墨西哥湾漂浮的大量石油,吸引了许多商人的目光。这些商人们有一种特殊的飞机,可以一瓢略过整个海面20米乘10米这么大的长方形。(上下相邻或者左右相邻的格子,不能斜着来)当然,这要求一瓢撇过去的全部是油,如果一瓢里面有油有水的话,那就毫无意义了,资源完全无法利用。现在,商人想要知道,在这...
2018-02-22 20:35:52
656
原创 2018年全国多校算法寒假训练营练习比赛(第三场)解题报告
2018年全国多校算法寒假训练营练习比赛(第三场)A 不凡的夫夫题目描述: 夫夫有一天对一个数有多少位数感兴趣,但是他又不想跟凡夫俗子一样, 所以他想知道给一个整数n,求n!的在8进制下的位数是多少位。输入描述: 第一行是一个整数t(0#include <bits/stdc++.h>using namespace std;#define ...
2018-02-22 19:11:55
459
1
原创 2018年全国多校算法寒假训练营练习比赛(第二场)解题报告
2018年全国多校算法寒假训练营练习比赛(第二场)题目源地址点此A 吐泡泡题目描述小鱼儿吐泡泡,嘟嘟嘟冒出来。小鱼儿会吐出两种泡泡:大泡泡"O",小泡泡"o"。两个相邻的小泡泡会融成一个大泡泡,两个相邻的大泡泡会爆掉。(是的你没看错,小气泡和大气泡不会产生任何变化的,原因我也不知道。)例如:ooOOoooO经过一段时间以后会变成oO。输入描述
2018-02-02 21:42:50
561
原创 Invitation Cards HDU - 1535 基础最短路
In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They
2017-08-25 21:38:49
398
原创 HDU Today HDU - 2112 模板最短路
经过锦囊相助,海东集团终于度过了危机,从此,HDU的发展就一直顺风顺水,到了2050年,集团已经相当规模了,据说进入了钱江肉丝经济开发区500强。这时候,XHD夫妇也退居了二线,并在风景秀美的诸暨市浬浦镇陶姚村买了个房子,开始安度晚年了。 这样住了一段时间,徐总对当地的交通还是不太了解。有时很郁闷,想去一个地方又不知道应该乘什么公交车,在什么地方转车,在什么地方下车(其实徐总自己有车,却一定要
2017-08-25 20:36:34
349
原创 Squares POJ2002 哈希的应用
A square is a 4-sided polygon whose sides have equal length and adjacent sides form 90-degree angles. It is also a polygon such that rotating about its centre by 90 degrees gives the same polygon. It
2017-08-16 22:21:30
352
原创 Air Raid POJ1422 & HDU1151 最小路径覆盖
Consider a town where all the streets are one-way and each street leads from one intersection to another. It is also known that starting from an intersection and walking through town's streets you can
2017-08-14 16:17:24
394
原创 IMMEDIATE DECODABILITY POJ - 1056 (字典树)
An encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this problem that all codes are in binary,
2017-08-13 16:07:10
366
原创 Xor Sum HDU - 4825 (字典树的运用)
Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异或结果最大。Prometheus 为了让 Zeus 看到人类的伟大,随即同意 Zeus 可以向人类求助。你能证明人类
2017-08-13 13:32:23
299
原创 Shortest Prefixes POJ - 2001 (字典树模板题~)
A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon". Note that the empty string is not co
2017-08-13 13:27:07
356
原创 Einbahnstrasse HDU - 2923 (Floyd, 注意建图)
题目描述Einbahnstra e (German for a one-way street) is a street on which vehicles should only move in one direction. One reason for having one-way streets is to facilitate a smoother flow of traffic
2017-08-12 17:32:59
296
原创 POJ 2355 Railway tickets 线性DP
题目地址~题目大意: X为距离 , 当0C1。 L1C2。L2思路: 线性dp, 直接在for循环里判断就好了, dp[i] = min(dp[j]+cost, 0AC CODE:#include #include #include using namespace std;int dp[10010];int main(void) { in
2017-08-12 17:10:38
396
原创 Max Sum HDU - 1003 求最大和
HDU 1003题目描述Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 +
2017-08-12 17:00:27
450
原创 Super Jumping! Jumping! Jumping! HDU - 1087
题目地址Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.
2017-08-12 16:41:52
273
原创 第一篇博客, 记录一下
转眼大学一年过去了。 一年前的现在刚刚了解到C语言并输出第一个程序 "Hello World"。一年过去了学到了什么我自己并不清楚。 感觉大二不能这么荒废下去了, 开个博客记录记录自己的学习历程。 明天把暑假集训的内容整理整理并写下题解。
2017-08-12 11:36:47
276
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人