自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(397)
  • 资源 (1)
  • 收藏
  • 关注

原创 7-4 城市间紧急救援

7-4 城市间紧急救援(25 分) 作为一个城市的应急救援队伍的负责人,你有一张特殊的全国地图。在地图上显示有多个分散的城市和一些连接城市的快速道路。每个城市的救援队数量和每一条连接两个城市的快速道路长度都标在地图上。当其他城市有紧急求助电话给你的时候,你的任务是带领你的救援队尽快赶往事发地,同时,一路上召集尽可能多的救援队。输入格式:输入第一行给出4个正整数N、M、S、D,其中N(2≤...

2018-03-24 15:29:34 451

原创 组合(Lucas)

Lucas 是用来求组合数取模的。 Lucas 定理:A、B是非负整数,p是质数。AB写成p进制:A=a[n]a[n-1]…a[0],B=b[n]b[n-1]…b[0]。 可以求逆元来解决,用费马小定理,或者是扩展欧几里得。 给出组合数C(n,m), 表示从n个元素中选出m个元素的方案数。例如C(5,2) = 10, C(4,2) = 6.可是当n,m比较大的时候,C(n,...

2018-03-16 09:39:47 470

原创 SDUT数三角形

数三角形 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem Description有多少种方法可以从1,2,3,4,….,n中选出3个不同的整数,使得以它们为三边长可以形成三角形? 比如n=5时有3种方法,即(2,3,4),(2,4,5),(3,4,5)。n = 8时有22种方法。Input...

2018-03-14 15:28:44 309

原创 SDUT 序列

序列 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem Description我们来定义这样一种序列,这个序列的第一个数字是n,并且数列中的每一项必须大于等于下一项的二倍(如果存在下一项)。我们想知道满足条件的合法序列有多少个? 比如n = 6 6 6 3 6 2 6 1 6 3 1 6...

2018-03-14 15:14:11 298

原创 SDUT Time

Time Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem DescriptionDigital clock use 4 digits to express time, each digit is described by 3*3 characters (including”|”,”_”and” “)...

2018-03-14 15:01:39 266

原创 取石子系列----四 取石子(六)(尼姆博弈)

取石子(六) 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 最近TopCoder的PIAOYI和HRDV很无聊,于是就想了一个游戏,游戏是这样的:有n堆石子,两个人轮流从其中某一堆中任意取走一定的石子,最后不能取的为输家,注意: 每次只能从一堆取任意个,可以取完这堆,但不能不取。假设PIAOYI先取石子,请你帮他判断他是否能赢(假设他们取的过程中不发生失误,

2018-02-03 19:23:43 337

原创 取石子系列----三 取石子(二) 巴什博奕+尼姆博弈

取石子(二) 时间限制:3000 ms | 内存限制:65535 KB 难度:5 描述 小王喜欢与同事玩一些小游戏,今天他们选择了玩取石子。游戏规则如下:共有N堆石子,已知每堆中石子的数量,并且规定好每堆石子最多可以取的石子数(最少取1颗)。两个人轮流取子,每次只能选择N堆石子中的一堆,取一定数量的石子(最少取一个),并且取的石子数量不能多于该堆石子规定好的最多取子数,等哪个人

2018-02-03 11:36:00 486

原创 取石子系列----二 取石子(七) 巴什博奕变形--两种

取石子(七) 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 Yougth和Hrdv玩一个游戏,拿出n个石子摆成一圈,Yougth和Hrdv分别从其中取石子,谁先取完者胜,每次可以从中取一个或者相邻两个,Hrdv先取,输出胜利着的名字。输入 输入包括多组测试数据。 每组测试数据一个n,数据保证int范围内。 输出 输出胜利者的名字。 样例输入

2018-02-03 10:05:17 349

原创 取石子系列----一 取石子(一)(巴什博奕)

取石子(一) 时间限制:3000 ms | 内存限制:65535 KB 难度:2 描述 一天,TT在寝室闲着无聊,和同寝的人玩起了取石子游戏,而由于条件有限,他/她们是用旺仔小馒头当作石子。游戏的规则是这样的。设有一堆石子,数量为N(1输入 第一行是一个正整数n表示有n组测试数据 输入有不到1000组数据,每组数据一行,有两个数N和M,之间用空格分隔。 输出 对于每组数据,输

2018-02-03 09:10:50 322

原创 Race to 1 Again (基础概率dp)

Rimi learned a new thing about integers, which is - any positive integer greater than 1 can be divided by its divisors. So, he is now playing with this property. He selects a number N. And he calls th

2018-02-02 10:26:55 717

原创 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

2018-02-02 08:50:26 486

原创 Romantic(扩展欧几里得+线性同余)

Romantic如果有多个解,输出x为非负数最小的解。。。。 扩展欧几里得+线性同余 注意long long#include #include #include #include #include #include #include #include #define INF 0x3f3f3f3fusing namespace std;long long int e

2018-01-31 09:45:45 264

原创 Supermarket(贪心+并查集)

A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment the s

2018-01-30 10:22:37 1033

原创 食物链(种类并查集)

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1 X Y”,表示X和Y是同类。 第二种说法是”2 X Y”,表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地

2018-01-30 08:49:40 387

原创 Maximum GCD

Maximum GCD Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers. Input The first line of input is an integer N (1 The follow

2018-01-27 09:25:19 398

原创 Queries about less or equal elements (lower_bound与upper_bound)

You are given two arrays of integers a and b. For each element of the second array bj you should find the number of elements in array a that are less than or equal to the value bj.Input The first l

2018-01-26 11:14:25 208

原创 Kefa and Company (排序+尺取)

Kefa wants to celebrate his first big salary by going to restaurant. However, he needs company.Kefa has n friends, each friend will agree to go to the restaurant if Kefa asks. Each friend is charact

2018-01-26 10:29:49 807

原创 Guess a number! (二分答案)

A TV show called “Guess a number!” is gathering popularity. The whole Berland, the old and the young, are watching the show.The rules are simple. The host thinks of an integer y and the participants

2018-01-26 09:16:07 332

原创 组合数学靠运气

组合数学靠运气 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Discuss Problem Descriptionn 个不同糖果,放到 m 个看起来一样礼品盒里。允许盒子为空。 求可用的方案数,答案对 20170825 取模。 Input输入两个数字 n, m(1⩽n,m⩽100)。 Output输出答

2018-01-25 15:53:52 303

原创 D - Chocolate Box (概率+dp)

Recently one of my friend Tarik became a member of the food committee of an ACM regional competition. He has been given m distinguishable boxes, he has to put n types of chocolates in the boxes. The

2018-01-25 15:04:09 260

原创 B - Fishmonger(dfs+剪枝)

A fishmonger wants to bring his goods from the port to the market. On his route he has to traverse an area with many tiny city states. Of course he has to pay a toll at each border.Because he is a g

2018-01-25 13:43:56 187

原创 C - Naughty Stone Piles(思维)

There are n piles of stones of sizes a1, a2, …, an lying on the table in front of you.During one move you can take one pile and add it to the other. As you add pile i to pile j, the size of pile j i

2018-01-25 09:53:22 451

原创 D - Squirrel and chestnut(二分)

D - Squirrel and chestnut There are n squirrel(s) waiting below the feet of m chestnut tree(s). The first chestnut of the i-th tree will fall right after Ti second(s), and one more every Pi second(s

2018-01-25 08:57:31 450

原创 A. Generate Login(string)

A. Generate Login(string)time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output The preferred way to generate user login in Polygon is to conca

2018-01-24 19:57:24 446

原创 A - Longest k-Good Segment (尺取,set, map)

The array a with n integers is given. Let’s call the sequence of one or more consecutive elements in a segment. Also let’s call the segment k-good if it contains no more than k different values.Find

2018-01-24 10:32:03 315

原创 Sum of Consecutive Prime Numbers(尺取,打表)

Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 27017 Accepted: 14575 DescriptionSome positive integers can be represented by a sum of one

2018-01-24 09:25:41 407

原创 Bound Found(尺取,poj2566, pair)

Bound Found Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 5079 Accepted: 1618 Special Judge DescriptionSignals of most probably extra-terrestrial origin have been recei

2018-01-24 09:09:45 189

原创 Poj3061(尺取法)

Subsequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17572 Accepted: 7481 DescriptionA sequence of N positive integers (10 InputThe first line is the number of te

2018-01-23 15:56:26 220

原创 济宁实训---成长

来到济宁实训这几天,我觉得自己突然成长了很多,有些事情,是在学校不会体验到的。 来济宁的第一天,在客车上,心里是激动的,面对着未知的期盼与憧憬。虽然有点晕,但是还是很开心呢。 到了这里,发现是和学校差不多的地方,有餐厅,操场,教学楼,而并不是我所想象的工厂。新的宿舍,老的舍友,我们收拾得很辛苦,但是还是会炫耀一下新搬的宿舍。新环境,新心境。 开始上课了,我居然不知道在说什么,服务器,S

2018-01-20 19:16:48 353 1

原创 电网项目

#include <stdio.h>#include <stdlib.h>#include <string.h>#define INF 0x3f3f3f3fint ma[121][121];//存储电网int q;//存路径条数int dist[1211];//存储距离int v[1211];//是否被访问int ka[121];//当前路径的前一个节点typedef struct

2018-01-11 21:10:07 900 2

原创 停车的管理系统

#include #include #include int Max;//容量typedef struct{ int *base;//起始地址 int stacksize;//大小 int front;//头 int rear;//尾} Queue; //队列结构typedef struct{ int * base;//栈底 int

2018-01-09 20:54:11 1148 1

原创 SVN的搭建

《SVN服务器搭建手册》一.下载和搭建SVN服务器:现在Subversion已经迁移到apache网站上了,下载地址:网址:http://subversion.apache.org/packages.html     这是二进制文件包的下载地址,你可在左侧的导航栏找到源代码,文档的下载地址.windows操作系统下面的二进制文件包一共有5种,如图:个人认为最好用Vi

2018-01-07 20:32:36 239

原创 Area(Pick)

Area Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 7064 Accepted: 3031Description Being well known for its highly innovative products, Merck would definitely be a good target f

2017-12-13 17:39:33 255

转载 D - Buy Low Sell High(multiset)

You can perfectly predict the price of a certain stock for the next N days. You would like to profit on this knowledge, but only want to transact one share of stock per day. That is, each day you will

2017-12-11 20:09:40 495

原创 1031. Hello World for U (20)

Hello World for U (20)Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. For example, “helloworld” can be printed as:h d e l l r lowoThat is, the c

2017-12-08 09:07:38 240

原创 1009. Product of Polynomials (25)

Product of Polynomials (25)This time, you are supposed to find A*B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each li

2017-12-06 19:26:44 165

原创 1008. Elevator (20)

Elevator (20)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. I

2017-12-06 17:40:48 175

原创 算法学习(一)-----朱流算法

前言 最近的学习,深深地感受到了算法分享的重要性。 应队友的要求,写一篇简单易懂的算法讲解(希望我写的出来),深入浅出(磨磨唧唧)的讲解一下朱刘算法。什么是朱刘算法大家应该都知道,如何求解最小生成树,可以使用Prim, 也可以使用Kruskal, 总而言之,就是寻找使得所有节点连通的权值最小的路径。 当然,这是基于无向图而言的,而对于有向图,我们要求“最小生成树”的话,就可以使用朱刘算法。

2017-11-25 22:07:57 430

原创 E - Super Jumping! Jumping! Jumping!

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.The game can be

2017-11-17 09:37:58 314

原创 1007. Maximum Subsequence Sum (25)

Maximum Subsequence Sum (25)Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1 <= i <= j <= K. The Maximum Subsequence is the conti

2017-11-17 09:35:28 243

Git学习笔记整理(Learn git branching)

Git学习笔记,网址:https://learngitbranching.js.org/?locale=zh_CN

2020-07-07

空空如也

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

TA关注的人

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