POJ - 2387 Til the Cows Come Home 【dijkstra】

Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. B...

2018-04-30 19:08:38

阅读数:13

评论数:0

HDU - 2544 最短路【dijkstra】

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

2018-04-30 17:09:32

阅读数:13

评论数:0

UVA - 1593 Alignment of Code

#include<iostream> #include<cstring> #include<vector> #include<sstream&a...

2018-04-25 20:40:06

阅读数:14

评论数:0

UVA - 12100 Printer Queue【优先队列+队列】

#include<iostream> #include<queue> #include<algorithm> using namespace std; struct ...

2018-04-25 16:11:46

阅读数:12

评论数:0

UVA - 1595 Symmetry 【暴力】

#include<iostream> #include<set> #include<algorithm> using namespace std; typedef p...

2018-04-25 15:17:54

阅读数:13

评论数:0

UVA - 1594 Ducci Sequence【vector+模拟】

#include<iostream> #include<string> #include<vector> #include<cmath&...

2018-04-24 21:29:54

阅读数:11

评论数:0

UVA-10391 Compound Words【string+map】

#include<iostream> #include<map> #include<string> using namespace std; const int ma...

2018-04-24 20:19:26

阅读数:23

评论数:0

UVA - 10763 Foreign Exchange【map】

#include<iostream> #include<map> #include<set> using namespace std; int main() { ...

2018-04-24 19:51:04

阅读数:6

评论数:0

UVA-10935 Throwing cards away I 【队列+模拟】

#include<iostream> #include<queue> using namespace std; int main() { int n; while(scanf(&quot...

2018-04-24 16:53:25

阅读数:15

评论数:0

UVA-442 Matrix Chain Multiplication【栈+模拟】

题意:输入n个矩阵的维度和一些矩阵链乘表达式;输出乘法的次数。如果两个矩阵无法相乘,输出error。题解:列:矩阵A维度 m*n,B 维度 n*p,则 AB 维度 m*p, 乘法的次数 m*n*p;出现error的情况是 A的列不等于B的行;我们可以用栈 存储矩阵链乘表达式的字母,遇到右括号出栈计...

2018-04-24 15:15:19

阅读数:13

评论数:0

UVA-136 Ugly Numbers 【优先队列】

题解:对于任意的丑数x,2x,3x,和5x 也都是丑数。通过使用优先队列保存已生成的丑数,每次取出最小的丑数,生成3个新的丑数;对生成的新丑数判重,在保存;#include<iostream> #include<queue&...

2018-04-23 18:34:29

阅读数:25

评论数:0

Uva 540 Team Queue 队列模拟

题意:有t个团队的人正在排一个长队,每次新来一个人,如果长队中有他的队友,那么新人就插入到最后一个队友中;倘若长队中没有队友,就排入到长队队尾。需要理解t个团队组成一队列,每个团队本身也是一个队列;#include<cstdio> #include&am...

2018-04-23 16:10:07

阅读数:11

评论数:0

Uva 156 Ananagrams

题意:输入一些单词,找出所有满足如下条件的单词:该单词不能通过字母重排,得到输入文本的另外一个单词。在判断是否满足条件时,字母不分大小写,但在输出时应保留输入中的大小写,按字典序进行排序。#include<iostream> #include&a...

2018-04-23 14:11:31

阅读数:26

评论数:0

Uva 101 The Blocks Problem

#include<iostream> #include<algorithm> #include<vector> using namespace std; const ...

2018-04-23 12:13:05

阅读数:15

评论数:0

UVA - 10474 Where is the Marble?

DescriptionRaju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju would place ...

2018-04-23 10:31:45

阅读数:7

评论数:0

HDU - 2141 Can you find it?

Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, Ck, whi...

2018-04-22 20:33:06

阅读数:12

评论数:0

UVA - 12289 One-Two-Three

Your little brother has just learnt to write one, two and three, in English. He has written a lot of thosewords in a paper, your task is to recognize...

2018-04-20 09:43:16

阅读数:23

评论数:0

快速排序(模板)

#include<iostream> using namespace std; const int maxn = 1e+5; int a[maxn]; void quick_Sort(int *a,int low,int high) { ...

2018-04-20 09:13:09

阅读数:19

评论数:0

POJ - 3318 Matrix Multiplication(随机化算法)

You are given three n × n matrices A, B and C. Does the equation A × B = C hold true?InputThe first line of input contains a positive integer n (n ≤ ...

2018-04-17 20:40:19

阅读数:14

评论数:0

POJ 3522 Slim Span

Description Given an undirected weighted graph G, you should find one of spanning trees specified as follows. The graph G is an ordered pair (V, E)...

2018-04-16 16:54:53

阅读数:17

评论数:0

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