- 博客(741)
- 资源 (10)
- 问答 (1)
- 收藏
- 关注
原创 POJ 1330 Nearest Common Ancestors (LCA)
Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In the figure, each node is labeled with an integer from {1, 2,…,16
2017-07-24 15:29:36 317
原创 hihocoder 1532 最美和弦 (dp)
描述 某个夜晚,Bob将他弹奏的钢琴曲录下来发给Jack,Jack感动之余决定用吉他为他伴奏。 我们可以用一个整数表示一个音符的音高,并可认为Bob弹奏的曲子是由3N个整数构成的一个序列。其中每个整数的取值范围是[-200, 200]。 Jack共弹奏 N 个和弦,每个和弦由三个音符组成。Jack可以自行决定和弦的第一个音符,其后的两个音符由第一个音符与和弦种类所决定。Jac
2017-07-24 10:32:50 587
原创 hihocoder 1531 德国心脏病 (模拟)
描述 Jack在和朋友们玩德国心脏病。 德国心脏病的游戏牌分为水果牌和动物牌。水果只有4种:香蕉、草莓、樱桃、柠檬,每张水果牌上会有种类不定、总数目1-5的水果;动物只有3种:猴子、大象、猪,每张动物牌上有且仅有一只动物。 n名玩家绕圈就座,第一轮游戏从0号至n-1号轮流出牌。每个玩家面前最多只有一张牌,如果玩家出牌时,他的面前已经摆放了一张牌,他新出的牌将会严丝合缝地盖住旧
2017-07-16 15:05:06 3674
原创 HDU 3966 Aragorn's Story (树链剖分)
Problem Description Our protagonist is the handsome human prince Aragorn comes from The Lord of the Rings. One day Aragorn finds a lot of enemies who want to invade his kingdom. As Aragorn knows, the
2017-07-14 21:30:31 351
原创 『数据结构』RMQ 问题
RMQ (Range Minimum/Maximum Query),即区间最值问题对于长度为 n 的数列,回复若干次查询,返回某个区间的最大(小)值
2017-07-13 21:56:13 511
原创 hiho一下 第158周 非法二进制数 (dp)
描述 如果一个二进制数包含连续的两个1,我们就称这个二进制数是非法的。 小Hi想知道在所有 n 位二进制数(一共有2n个)中,非法二进制数有多少个。 例如对于 n = 3,有 011, 110, 111 三个非法二进制数。 由于结果可能很大,你只需要输出模109+7的余数。 输入 一个整数 n (1 ≤ n ≤ 100)。 输出 n 位非法二进制数的数目
2017-07-13 17:29:04 513
原创 POJ 3264 Balanced Lineup (RMQ)
Description For the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows. To
2017-07-13 15:03:36 237
原创 SPOJ QTREE - Query on a tree (树链剖分)
Description You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3…N-1. We will ask you to perfrom some instructions of the following form:
2017-07-09 16:58:37 528
原创 操作系统 -- PV操作
三态模型进程通常分为就绪、运行和阻塞三种工作状态。三种状态在某些条件下可以转换,具体转换关系如下:进程三个状态之间的转换是通过PV操作和信号量来控制的,其中信号量起到了很重要的作用。 信号量 信号量是最早出现的用来解决进程同步与互斥问题的机制。 信号量(Saphore)由一个值和一个指针组成,指针指向等待该信号量的进程,信号量的值表示相应资源的使用情况。 信号量 S>=0 时
2017-07-03 19:47:33 10131 2
原创 hiho一下 第157周 二进制小数 (二进制)
描述 给定一个十进制小数X,判断X的二进制表示是否是有限确定的。 例如0.5的二进制表示是0.1,0.75的二进制表示是0.11,0.3没有确定有限的二进制表示。 输入 第一行包含一个整数 T (1 ≤ T ≤ 10),表示测试数据的组数。 以下T行每行包含一个十进制小数 X (0 < X < 1)。 X一定是以”0.”开头,小数部分不超过100位。 输出 对于每
2017-07-02 10:12:30 684
原创 hiho一下 第156周 岛屿 (dfs)
描述 给你一张某一海域卫星照片,你需要统计: 照片中海岛的数目 照片中面积不同的海岛数目 照片中形状不同的海岛数目 其中海域的照片如下,”.”表示海洋,”#”表示陆地。在”上下左右”四个方向上连在一起的一片陆地组成一座岛屿。 .####.......#.####.#......#...##.#. 上图所示的照片中一共有4座岛屿;其中3座面
2017-06-26 21:16:57 741
原创 SDUT 3923 打字 (贪心)
Problem Description snow 是个热爱打字的家伙,每次敲出更快的速度都会让他很开心。现在,他拿到一篇新的打字文章,已知这篇文章只有 26 个小写英文字母,给出 snow 打出这 26 个英文字母分别需要多少时间 (s),问 snow 打完这篇文章获得的 kpm(打正确的字数/所花的分钟数)最大为多少? 注意 snow 可能会打错一些字哦。打错的必定是文章里面存在的。
2017-06-05 12:52:46 618
原创 UVA Live 3704 Cellular Automaton (循环矩阵+快速幂)
Description A cellular automaton is a collection of cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of rules that describe the new state of a
2017-06-03 19:53:37 593
原创 山东省第八届 ACM 省赛 fireworks (组合数+逆元)
Description Hmz likes to play fireworks, especially when they are put regularly. Now he puts some fireworks in a line. This time he put a trigger on each firework. With that trigger, each firewo
2017-05-23 16:52:38 995
原创 山东省第八届 ACM 省赛 Parity check (规律、水)
Description Fascinated with the computer games, Gabriel even forgets to study. Now she needs to finish her homework, and there is an easy problem: >f(n)=⎧⎩⎨>0,n=0>1,n=1>f(n−1)+f(n−2),n≥2>>> f(n)=
2017-05-23 16:27:10 674
原创 山东省第八届 ACM 省赛 Quadrat (找规律)
Description It is well-known that for any n there are exactly four n-digit numbers (including ones with leading zeros) that are self-squares: the last n digits of the square of such number are equal
2017-05-23 15:58:53 1066
原创 Codeforces 794 C. Naming Company (贪心)
Description Oleg the client and Igor the analyst are good friends. However, sometimes they argue over little things. Recently, they started a new company, but they are having trouble finding a name f
2017-05-13 21:05:43 2354
原创 山东省第八届 ACM 省赛 company (贪心、水)
Problem Description There are n kinds of goods in the company, with each of them has a inventory of cnti and direct unit benefit vali. Now you find due to price changes, for any goods sold on day i,
2017-05-09 19:51:11 1360
原创 山东省第八届 ACM 省赛 CF (01背包、水)
Problem Description LYD loves codeforces since there are many Russian contests. In an contest lasting for T minutes there are n problems, and for the ith problem you can get ai−di∗ti points, where ai
2017-05-09 19:30:19 1487
原创 山东省第八届 ACM 省赛 sum of power (求和、水)
Problem Description Calculate ∑ni=1im mod (1000000000+7)\sum_{i=1}^ni^m~mod~(1000000000+7) for given n,m.Input Input contains two integers n,m(1≤n≤1000,0≤m≤10).Output Output the answer in a sin
2017-05-09 19:04:21 769
原创 山东省第八届 ACM 省赛 quadratic equation (水、坑)
Problem Description With given integers a,b,c, you are asked to judge whether the following statement is true: “For any x, if a⋅x2+b⋅x2+c=0a⋅x^2+b⋅x^2+c=0 , then x is an integer.”Input The first l
2017-05-09 18:48:38 1032
原创 UPC 1017 Easy Tree Query (二叉搜索树)
题目描述 You are given a binary search tree with depth k, whose nodes are valued from 1 to (2k − 1) and then Q queries. For each query, you are given p nodes. Find the root of a smallest subtree whi
2017-05-05 10:54:16 594
原创 山东省第七届 ACM 省赛 Feed the monkey (dp)
Problem Description Alice has a monkey, she must feed fruit to the monkey every day.She has three kinds of fruits, bananas, peaches and apples. Every day, she chooses one in three, and pick one of th
2017-05-04 17:40:26 711
原创 POJ 2926 Requirements (空间最远曼哈顿距离)
Description An undergraduate student, realizing that he needs to do research to improve his chances of being accepted to graduate school, decided that it is now time to do some independent research.
2017-05-04 15:05:36 1521
原创 HDU 4622 Reincarnation (区间不相同子串个数:字符串哈希 | 后缀数组 | 后缀自动机)
Problem Description Now you are back,and have a task to do: Given you a string s consist of lower-case English letters only,denote f(s) as the number of distinct sub-string of s. And you ha
2017-05-03 17:16:21 1922 1
原创 HDU 4333 Revolving Digits (扩展KMP)
Problem Description One day Silence is interested in revolving the digits of a positive integer. In the revolving operation, he can put several last digits to the front of the integer. Of course, he
2017-05-03 16:04:13 535
原创 山东省第二届 ACM 省赛 Simple Game (Nim+Bash)
Problem Description Here is a simple game. In this game, there are several piles of stones and two players. The two players play in turn. In each turn, one can choose at least one pile and at most th
2017-05-03 09:36:25 685
原创 POJ 1679 The Unique MST (次小生成树)
Description Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of
2017-05-02 20:52:26 542
原创 HDU 5976 Detachment (逆元)
Problem Description In a highly developed alien society, the habitats are almost infinite dimensional space. In the history of this planet,there is an old puzzle. You have a line segment wi
2017-05-02 16:15:45 877
原创 HDU 5974 A Simple Math Problem (数论+解方程组)
Problem Description Given two positive integers a and b,find suitable X and Y to meet the conditions: X+Y=a Least Common Multiple (X, Y) =bInput Input includes multiple sets of test data
2017-05-02 10:46:45 1016
原创 多校联合集训 G. 数字逻辑练习题 (普通计算)
题目描述 原码、反码、补码都是一样的,都是正数本身。 对于负数: 原码是符号位为 1,数值部分取绝对值的二进制。 反码是符号位为 1,其它位是原码取反。 补码是符号位为 1,其它位是原码取反,未位加 1。 输入一个 64bit 十进制整数,输出它的原码,反码,补码的 16 进制表示法 输入 有多组数据,每组数据一行,为一个 64bi
2017-05-01 21:25:05 670
原创 多校联合集训 A. 字符串“水”题 (状压+哈希)
题目描述 给出一个长度为 n 的字符串(1<=n<=100000),求有多少个连续字串中所有的字母都出现了偶数次。 输入 第一行一个正整数 T,表示数据组数(1 <= T <= 10)。 接下来 T 行,每行有一个只包含小写字母的字符串。 输出 每个答案输出满足要求字符串个数。每个答案占一行。样例输入3aaabbccabcabc样例输出061思路某位学长写
2017-05-01 20:59:22 7000
原创 URAL 2018. The Debut Album (dp)
Description Pop-group “Pink elephant” entered on recording their debut album. In fact they have only two songs: “My love” and “I miss you”, but each of them has a large number of remixes. The pr
2017-04-30 21:39:29 500
原创 POJ 2400 Supervisor, Supervisee (二分图最大权匹配)
Description Suppose some supervisors each get to hire a new person for their department. There are N people to be placed in these N departments. Each supervisor interviews all N people, and ranks the
2017-04-30 19:38:41 566
原创 HDU 2255 奔小康赚大钱 (二分图最大权匹配)
Problem Description 传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。 这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子。 另一方面,村长和另外的村领导希望得到最大的效益,这样村里的机构才
2017-04-27 21:31:28 699
原创 山东省第六届 ACM 省赛 Stars (尺取法)
Problem Description There are N (1 ≤ N ≤ 400) stars in the sky. And each of them has a unique coordinate (x, y) (1 ≤ x, y ≤ N). Please calculate the minimum area of the rectangle (the edges of the re
2017-04-27 17:33:48 720
原创 山东省第七届 ACM 省赛 Proxy (最短路)
Problem Description Because of the GFW (Great Firewall), we cannot directly visit many websites, such as Facebook, Twitter, YouTube, etc. But with the help of proxy and proxy server, we can easily ge
2017-04-27 09:10:54 661
原创 POJ 3308 Paratroopers (最小割)
Description It is year 2500 A.D. and there is a terrible war between the forces of the Earth and the Mars. Recently, the commanders of the Earth are informed by their spies that the invaders of Mars
2017-04-25 21:43:03 539
原创 HZAU 1208 Color Circle (dfs)
Description There are colorful flowers in the parterre in front of the door of college and form many beautiful patterns. Now, you want to find a circle consist of flowers with same color. What should
2017-04-24 17:20:17 500
原创 HZAU 1202 GCD (矩阵快速幂 + GCD)
Problem Description Xiao Ming found the compute time of gcd(fibn,fibn+1)gcd(fib_n,fib_{n+1}) is the most when he learnt the gcd, and the result of it is always fib1 but he is not satisfied with the s
2017-04-23 19:58:04 823
Spig 网站浮动小人 (javascript)
2018-06-17
OICQ 聊天室(Java 课程设计)
2018-06-17
Little Giant (C++ 课程设计)
2018-06-17
Flow blog(数据库课程设计)
2018-06-17
Codeforces Edu Hacking
2018-06-17
HDU 自动 AC 机(Python)
2018-06-17
黑白棋 (Reversi)
2016-10-30
黑客帝国C语言
2016-01-07
VC绘图库Easyx
2016-01-05
C语言一个小小的问题,望解答
2016-01-08
TA创建的收藏夹 TA关注的收藏夹
TA关注的人