Coldfresh的博客

keeeeeep!~

【51nod】最大公约数之和(简单数论或者积性)

给出一个n,求1-n这n个数,同n的最大公约数的和。比如:n = 6 1,2,3,4,5,6 同6的最大公约数分别为1,2,3,2,1,6,加在一起 = 15 Input 1个数N(N <= 10^9) Output 公约数之和 Input示例 ...

2018-08-28 15:28:16

阅读数:26

评论数:0

【51nod】最复杂的数 (简单搜索)

基准时间限制:1 秒 空间限制:131072 KB 分值: 40 把一个数的约数个数定义为该数的复杂程度,给出一个n,求1-n中复杂程度最高的那个数。 例如:12的约数为:1 2 3 4 6 12,共6个数,所以12的复杂程度是6。如果有多个数复杂度相等,输出最小的。 Input 第1行:...

2018-08-28 13:19:36

阅读数:42

评论数:0

Sudoku POJ - 3074(DFS)

Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cel...

2018-05-10 21:14:30

阅读数:38

评论数:0

Addition Chains POJ - 2248(加深迭代搜索)

An addition chain for n is an integer sequence with the following four properties: a0 = 1 am = n a0 < a1 < a2 &lt...

2018-04-05 15:34:13

阅读数:44

评论数:0

Sticks POJ - 1011(枚举+dfs)

George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the origin...

2018-03-20 17:30:17

阅读数:39

评论数:0

(pat)A1103. Integer Factorization

The K-P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program ...

2018-03-13 16:50:09

阅读数:29

评论数:0

(pat)A1013. Battle Over Cities

It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that ...

2018-03-09 11:57:27

阅读数:53

评论数:0

Travel HDU - 4284(dfs或状压dp)

PP loves travel. Her dream is to travel around country A which consists of N cities and M roads connecting them. PP has measured the money each road ...

2017-11-05 20:45:01

阅读数:73

评论数:0

Digital Square HDU - 4394 (数论)(DFS)

Given an integer N,you should come up with the minimum nonnegative integer M.M meets the follow condition: M2mod10x=nM^2 mod 10^x=n(x=0,1,2,3….) In...

2017-10-16 00:18:10

阅读数:80

评论数:0

Pocket Cube HDU - 4801 (dfs)

Pocket Cube is a 3-D combination puzzle. It is a 2 × 2 × 2 cube, which means it is constructed by 8 mini-cubes. For a combination of 2 × 2 mini-cubes...

2017-09-29 15:15:00

阅读数:89

评论数:0

Connections between cities HDU - 2874(LCA)(RMQ)(dfs)(st算法)

After World War X, a lot of cities have been seriously damaged, and we need to rebuild those cities. However, some materials needed can only be produ...

2017-09-15 16:38:59

阅读数:101

评论数:0

DeBruijin HDU - 2894 (df或欧拉回路)

旋转鼓的表面分成m块扇形,如图所示(m=8)。图中阴影区表示用导电材料制成,空白区用绝缘材料制成,终端a、b和c是3(k=3)处接地或不是接地分别用二进制信号0或1表示。因此,鼓的位置可用二进制信号表示。试问应如何选取这8个扇形的材料使每转过一个扇形都得到一个不同的二进制信号,即每转一周,能得到0...

2017-08-18 15:49:22

阅读数:157

评论数:0

More Divisors ZOJ - 2562 (反素数)

Everybody knows that we use decimal notation, i.e. the base of our notation is 10. Historians say that it is so because men have ten fingers. Maybe t...

2017-07-29 14:03:37

阅读数:151

评论数:0

Genghis Khan the Conqueror HDU - 4126(MST)

Genghis Khan(成吉思汗)(1162-1227), also known by his birth name Temujin(铁木真) and temple name Taizu(元太祖), was the founder of the Mongol Empire and the gre...

2017-07-22 11:48:11

阅读数:108

评论数:0

哈密顿绕行世界问题 (HDU - 2181 )(DFS)

一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input 前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出. Output 输出...

2017-04-22 11:49:19

阅读数:120

评论数:0

棋盘问题(dfs)(poj-1321)

在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开...

2017-04-17 20:50:18

阅读数:321

评论数:0

网络寻路(深搜)

问题描述 X 国的一个网络使用若干条线路连接若干个节点。节点间的通信是双向的。某重要数据包,为了安全起见,必须恰好被转发两次到达目的地。该包可能在任意一个节点产生,我们需要知道该网络中一共有多少种不同的转发路径。源地址和目标地址可以相同,但中间节点必须不同。如下图所示的网络。1 -> 2 ...

2017-04-05 14:53:12

阅读数:208

评论数:0

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