自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 HDU - 4686 Arc of Dream(5*5构造矩阵快速幂)

An Arc of Dream is a curve defined by following function: where a 0 = A0 a i = a i-1*AX+AY b 0 = B0 b i = b i-1*BX+BY What is the value of AoD(N) modulo 1,000,000,007? Input There are multiple ...

2018-08-05 22:28:25 184

原创 HDU - 1005 Number Sequence(长得像矩阵快速幂的找规律)

A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n). Input The input consists of multi...

2018-08-05 22:25:50 153

原创 POJ - 1845 Sumdiv (质因数分解+快速幂+等比数列快速求和)

Consider two natural numbers A and B. Let S be the sum of all natural divisors of A^B. Determine S modulo 9901 (the rest of the division of S by 9901). Input The only line contains the two natural ...

2018-08-05 22:22:35 193

原创 HDU - 5685 逆元+前缀积

度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了一个很长很长的字符串。现在麻烦来了,他忘记了原来的字符串都是什么,神奇的是他竟然记得原来那些字符串的哈希值。一个字符串的哈希值,由以下公式计算得到: H(s)=∏i≤len(s)i=1(Si−28) (mod 9973)H(s)=∏i=1i≤len(s)(Si−28) (mod 9973) SiSi 代表 S[i] 字符的 ASCII...

2018-08-05 22:18:04 234

原创 LightOJ - 1067 Combinations(逆元求组合数)

Given n different objects, you want to take k of them. How many ways to can do it? For example, say there are 4 items; you want to take 2 of them. So, you can do it 6 ways. Take 1, 2 Take 1, 3 Ta...

2018-08-05 22:15:18 213

原创 CodeForces - 766D Mahmoud and a Dictionary 并查集

Mahmoud wants to write a new dictionary that contains n words and relations between them. There are two types of relations: synonymy (i. e. the two words mean the same) and antonymy (i. e. the two wo...

2018-07-29 23:26:21 130

原创 Gym - 101521A Shuttle Bus 模拟/搜索?

Alex is a driver of a shuttle bus whose working duty is to drive around Byteland and let the tourists do sightseeing there. The territory of Byteland is strange which can be represent by an grid wit...

2018-07-29 23:23:17 219

原创 HDU-1875 最小生成树模板题

相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。当然,为了节省资金,只要求实现任意2个...

2018-07-29 23:17:36 219

原创 HDU-6201 transaction transaction transaction (源点+汇点)最短路

Kelukin is a businessman. Every day, he travels around cities to do some business. On August 17th, in memory of a great man, citizens will read a book named "the Man Who Changed China". Of course, Ke...

2018-07-29 23:14:14 186

原创 HDU-2962 Trucking 最短路

A certain local trucking company would like to transport some goods on a cargo truck from one place to another. It is desirable to transport as much goods as possible each trip. Unfortunately, one ca...

2018-07-29 23:11:27 241

原创 HDU-2544 最短路模板

在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?   Input 输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口...

2018-07-29 23:09:43 127

原创 Codeforce546C Soldier and Cards 队列模拟

Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are different. They divide cards between them in some manner, it's possible that...

2018-07-29 23:07:37 148

原创 51NOD-1051 最大子矩阵和 dp

一个M*N的矩阵,找到此矩阵的一个子矩阵,并且这个子矩阵的元素的和是最大的,输出这个最大的值。 例如:3*3的矩阵:   -1 3 -1 2 -1 3 -3 1 2   和最大的子矩阵是:   3 -1 -1 3 1 2 Input 第1行:M和N,中间用空格隔开(2 <= M,N <= 500)。 第2 - N + 1行:矩阵中的元素,每行M个数,中间用空...

2018-07-29 23:05:25 149

原创 Codeforce 450B Jzzhu and Sequences 矩阵快速幂

Jzzhu has invented a kind of sequences, they meet the following property: You are given x and y, please calculate fn modulo 1000000007 (109 + 7). The first line contains two integers x and y (|x|...

2018-07-29 22:53:55 124

原创 HDU-1242 Rescue BFS

HDU-1242   Rescue Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison. Ange...

2018-07-29 22:47:41 163

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除