- 博客(14)
- 资源 (2)
- 收藏
- 关注
原创 CodeForces - 892 C - Pride【GCD思维】
ou have an array a with length n, you can perform operations. Each operation is like this: choose two adjacent elements from a, say x and y, and replace one of them with gcd(x, y), where gcd denotes th
2017-11-19 16:21:17 406
原创 CodeForces 711C Coloring Trees【dp*好题】
ZS the Coder and Chris the Baboon has arrived at Udayland! They walked in the park where n trees grow. They decided to be naughty and color the trees in the park. The trees are numbered with integers ...
2017-11-18 14:24:26 464
原创 LightOJ 1027 Dangerous Maze【期望】
You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors. If you choose the ith door, it can either
2017-11-16 21:39:33 187
原创 LightOJ 1030 Discovering Gold【概率dp】
You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold. Initially you are in position 1. Now each turn you throw a perfect 6
2017-11-16 21:17:33 181
原创 HDU 2444 The Accomodation of Students【二分图染色+匹配*好题】
题目链接 题意:编号1~n,给你几组互为朋友的关系。现在让你分两组,且同一组的人之间不能认识。如果可以分配,现在让你分方间,同一房间的人为朋友住双人间,问你需要多少双人间,不可以分配就No. 思路:分两组可以进行简单的二分图染色,分房间时就是最大匹配了。但是我却wa着过的,建图时需要注意:大家编号没变,用原来的编号时,已经在左端匹配的编号i,不能在另一组继续匹配了(或者不加标识,直接结果除2,都
2017-11-14 16:55:54 145
原创 HDU 3478 Catch【二分图+思维】
A thief is running away! We can consider the city where he locates as an undirected graph in which nodes stand for crosses and edges stand for streets. The crosses are labeled from 0 to N–1. Th
2017-11-13 21:01:27 291
原创 HDU 4751 Divide Groups【二分图染色】
This year is the 60th anniversary of NJUST, and to make the celebration more colorful, Tom200 is going to invite distinguished alumnus back to visit and take photos. After carefully planning, Tom
2017-11-13 16:09:59 194
原创 HDU - 3586 Information Disturbing【树形dp+二分】
In the battlefield , an effective way to defeat enemies is to break their communication system.The information department told you that there are n enemy soldiers and their network which have n-1 comm
2017-11-13 08:56:51 285
原创 CodeForces - 219D Choosing Capital for Treeland【树形dp*好题】
The country Treeland consists of n cities, some pairs of them are connected with unidirectional roads. Overall there are n - 1 roads in the country. We know that if we don't take the direction of the r
2017-11-11 16:49:13 307
原创 POJ - 3107 Godfather【树形dp+树的重心】
GodfatherTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7728 Accepted: 2741DescriptionLast years Chicago was full of gangster fights and strang
2017-11-10 15:53:27 293
原创 codeforces 754D Fedor and coupons【优先队列+贪心*好题】
D. Fedor and couponstime limit per test4 secondsAll our characters have hobbies. The same is true for Fedor. He enjoys shopping in the neighboring supermarket.The goods in the supermarket have unique ...
2017-11-09 17:48:19 325
原创 HDU 2196【树形dp*好题】
A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of settled earlier. Ma
2017-11-08 21:35:22 256
原创 Wrestling Match【DFS+二分图染色】
题目链接 题意: 给你n, m, x, y四个数,n代表编号,接下来m行,每行两个数a,b,二者PK,其中一方为好人将不会输,接下来x个好人和y个坏人;问是否能够将每个人划分成好人或者坏人。 思路: 二分图染色问题,注意读题; 在已知的好人坏人中第一遍DFS,在余下的图中未知的位置,分别填上好人坏人的条件下看看是否都矛盾;#include <cstdio>#include <cstrin
2017-11-07 17:58:43 248
原创 数论总结
前言:走进区域赛,切实的发现数论和思维的重要性,于是弱鸡努力总结一波!一:约数个数定理定义g(x),为x的约数个数,对于一个数i,可分解成若干质数幂次的乘积,即: i=prime[1]a∗prime[2]b∗….. g(i)=(a+1)∗(b+1)∗……二:整除的基本性质a|b b|c => a|c a|b a|c => a|bc a|b a|c => a|ib±jc
2017-11-06 22:27:54 636
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人