- 博客(25)
- 资源 (10)
- 问答 (1)
- 收藏
- 关注
原创 HDU 6041 I Curse Myself (仙人掌图)
Description There is a connected undirected graph with weights on its edges. It is guaranteed that each edge appears in at most one simple cycle. Assuming that the weight of a weighted spanning
2017-07-31 21:48:12 500
原创 『数论』乘法逆元
在求解除法取模问题 (a/b)%m(a/b)\%m 时,我们可以转化为 (a%(b×m))/b(a\%(b×m))/b ,但是如果 bb 很大,则会出现爆精度问题,所以我们避免使用除法直接计算。可以使用逆元将除法转换为乘法:假设 bb 存在乘法逆元,即与 mm 互质(充要条件)。设 cc 是 bb 的逆元,即 b×c≡1(mod m)b×c≡1(mod~m)那么有 a/b=(a/b)×1=(a/b)
2017-07-31 11:47:27 622
原创 HDU 3594 Cactus (仙人掌图、Tarjan)
Description It is a Strongly Connected graph. Each edge of the graph belongs to a circle and only belongs to one circle. We call this graph as CACTUS. There is an example as t
2017-07-30 17:05:19 555
原创 HDU 6044 Limited Permutation (组合数+逆元)
Description As to a permutation p1,p2,⋯,pn from 1 to n, it is uncomplicated for each 1≤i≤n to calculate (li,ri) meeting the condition that min(pL,pL+1,⋯,pR)=pi if and only if li≤L≤i≤R≤ri for each 1≤L
2017-07-30 12:54:40 616
原创 HDU 6047 Maximum Sequence (贪心)
Description Steph is extremely obsessed with “sequence problems” that are usually seen on magazines: Given the sequence 11, 23, 30, 35, what is the next number? Steph always finds them too easy for s
2017-07-28 18:16:12 572
原创 HDU 6053 TrickGCD (莫比乌斯函数)
Description You are given an array AA , and Zhu wants to know there are how many different array BB satisfy the following conditions? 1≤Bi≤Ai1≤B_i≤A_i For each pair(l,r) (1≤l≤r≤n)(1≤l≤r≤n)
2017-07-28 14:05:10 908
原创 HDU 6055 Regular polygon (找正方形)
Description On a two-dimensional plane, give you n integer points. Your task is to figure out how many different regular polygon these points can make. Input The input file consists of several tes
2017-07-27 18:37:26 1146
原创 HDU 6050 Funny Function (规律+逆元)
Description Function Fx,yF_{x,y} satisfies: F1,1=F1,2=1F_{1,1}=F_{1,2}=1 F1,i=F1,i−1+2∗F1,i−2 (i>=3)F_{1,i}=F_{1,i-1}+2*F_{1,i-2}\ (i>=3) Fi,j=∑j+N−1k=jFi−1,k (i>=2,j>=1)F_{i,j}=\sum_{
2017-07-27 18:32:07 902 4
原创 HDU 6040 Hints of sd0061 (技巧)
Description sd0061, the legend of Beihang University ACM-ICPC Team, retired last year leaving a group of noobs. Noobs have no idea how to deal with m coming contests. sd0061 has left a set of hints f
2017-07-27 11:25:09 913
原创 codevs 2370 小机房的树 (LCA)
Description 小机房有棵焕狗种的树,树上有N个节点,节点标号为0到N-1,有两只虫子名叫飘狗和大吉狗,分居在两个不同的节点上。有一天,他们想爬到一个节点上去搞基,但是作为两只虫子,他们不想花费太多精力。已知从某个节点爬到其父亲节点要花费 c 的能量(从父亲节点爬到此节点也相同),他们想找出一条花费精力最短的路,以使得搞基的时候精力旺盛,他们找到你要你设计一个程序来找到这条路,要求你告诉
2017-07-27 09:40:03 283
原创 HDU 6035 Colorful Tree (树形dp)
Description There is a tree with n nodes, each of which has a type of color represented by an integer, where the color of node i is ci. The path between each two different nodes is unique, of wh
2017-07-26 20:35:55 536
原创 HDU 6038 Function (数学)
Description You are given a permutation a from 0 to n−1 and a permutation b from 0 to m−1. Define that the domain of function f is the set of integers from 0 to n−1, and the range of it is the s
2017-07-26 14:11:26 1170
原创 HDU 6034 Balala Power! (贪心)
Description Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each numbe
2017-07-26 10:54:43 383
原创 codevs 1036 商务旅行 (LCA)
Description 某首都城市的商人要经常到各城镇去做生意,他们按自己的路线去做,目的是为了更好的节约时间。 假设有N个城镇,首都编号为1,商人从首都出发,其他各城镇之间都有道路连接,任意两个城镇之间如果有直连道路,在他们之间行驶需要花费单位时间。该国公路网络发达,从首都出发能到达任意一个城镇,并且公路网络不会存在环。 你的任务是帮助该商人计算一下他的最短旅行时间。 I
2017-07-25 10:23:42 511
原创 POJ 1470 Closest Common Ancestors (LCA)
Description Write a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The close
2017-07-24 16:19:38 389
原创 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 305
原创 hihocoder 1532 最美和弦 (dp)
描述 某个夜晚,Bob将他弹奏的钢琴曲录下来发给Jack,Jack感动之余决定用吉他为他伴奏。 我们可以用一个整数表示一个音符的音高,并可认为Bob弹奏的曲子是由3N个整数构成的一个序列。其中每个整数的取值范围是[-200, 200]。 Jack共弹奏 N 个和弦,每个和弦由三个音符组成。Jack可以自行决定和弦的第一个音符,其后的两个音符由第一个音符与和弦种类所决定。Jac
2017-07-24 10:32:50 576
原创 hihocoder 1531 德国心脏病 (模拟)
描述 Jack在和朋友们玩德国心脏病。 德国心脏病的游戏牌分为水果牌和动物牌。水果只有4种:香蕉、草莓、樱桃、柠檬,每张水果牌上会有种类不定、总数目1-5的水果;动物只有3种:猴子、大象、猪,每张动物牌上有且仅有一只动物。 n名玩家绕圈就座,第一轮游戏从0号至n-1号轮流出牌。每个玩家面前最多只有一张牌,如果玩家出牌时,他的面前已经摆放了一张牌,他新出的牌将会严丝合缝地盖住旧
2017-07-16 15:05:06 2888
原创 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 334
原创 『数据结构』RMQ 问题
RMQ (Range Minimum/Maximum Query),即区间最值问题对于长度为 n 的数列,回复若干次查询,返回某个区间的最大(小)值
2017-07-13 21:56:13 493
原创 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 501
原创 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 230
原创 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 514
原创 操作系统 -- PV操作
三态模型进程通常分为就绪、运行和阻塞三种工作状态。三种状态在某些条件下可以转换,具体转换关系如下:进程三个状态之间的转换是通过PV操作和信号量来控制的,其中信号量起到了很重要的作用。 信号量 信号量是最早出现的用来解决进程同步与互斥问题的机制。 信号量(Saphore)由一个值和一个指针组成,指针指向等待该信号量的进程,信号量的值表示相应资源的使用情况。 信号量 S>=0 时
2017-07-03 19:47:33 9939 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 662
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关注的人