![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
寒假集训
Lyang0.0
这个作者很懒,什么都没留下…
展开
-
顺序表应用1:多余元素删除之移位算法
一个长度不超过10000数据的顺序表,可能存在着一些值相同的“多余”数据元素(类型为整型),编写一个程序将“多余”的数据元素从顺序表中删除,使该表由一个“非纯表”(值相同的元素在表中可能有多个)变成一个“纯表”(值相同的元素在表中只保留第一个)。要求:1、必须先定义线性表的结构与操作函数,在主函数中借助该定义与操作函数调用实现问题功能;2、本题的目标是熟悉顺序表的移位算法,因此题目必须要用元...原创 2018-12-13 22:06:23 · 114 阅读 · 0 评论 -
SDUT-Wormholes(Floyd判断负环)
While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time that i...原创 2019-01-22 11:31:00 · 154 阅读 · 0 评论 -
SDUT- Invitation Cards(最短路 spfa)
In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They ...原创 2019-01-22 20:27:39 · 111 阅读 · 0 评论 -
Tickets(简单dp)
Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he go back home as early as...原创 2019-02-21 15:34:36 · 172 阅读 · 0 评论 -
Sasha and Array (线段树 + 快速幂)
Sasha has an array of integersa1, a2, ..., an. You have to performmqueries. There might be queries of two types:1 l r x— increase all integers on the segment fromltorby valuesx; 2 l r— fi...原创 2019-02-21 17:28:18 · 212 阅读 · 1 评论 -
SDUT-食物链(带权并查集)
动物王国中有三类动物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个动物,用上述两种说法,一句接一句地说出K句话,这K句话...原创 2019-02-17 09:21:49 · 150 阅读 · 1 评论 -
SDUT-小希的迷宫(带权并查集)
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的...原创 2019-02-17 10:02:25 · 172 阅读 · 0 评论 -
SDUT-233 Matrix(矩阵快速幂)
In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 ... in the same meaning. And here is the question: Suppose we have a matrix called 233 matrix. I...原创 2019-02-19 10:48:31 · 132 阅读 · 0 评论 -
SDUT-A Short problem (矩阵快速幂+循环节)
According to a research, VIM users tend to have shorter fingers, compared with Emacs users. Hence they prefer problems short, too. Here is a short one: Given n (1 <= n <= 1018), You sho...原创 2019-02-19 10:52:39 · 115 阅读 · 0 评论 -
SDUT-Queries about less or equal elements(upper_bound函数)
You are given two arrays of integersaandb. For each element of the second arraybjyou should find the number of elements in arrayathat are less than or equal to the valuebj.输入The first line...原创 2019-02-19 11:07:42 · 127 阅读 · 0 评论 -
SDUT-画8(打印图形)
谁画8画的好,画的快,今后就发的快,学业发达,事业发达,祝大家发,发,发.输入输入的第一行为一个整数N,表示后面有N组数据.每组数据中有一个字符和一个整数,字符表示画笔,整数(>=5)表示高度.输出画横线总是一个字符粗,竖线随着总高度每增长6而增加1个字符宽.当总高度从5增加到6时,其竖线宽度从1增长到2.下圈高度不小于上圈高度,但应尽量接近上圈高度,且下圈的内径呈正...原创 2019-02-21 08:49:03 · 149 阅读 · 0 评论 -
SDUT-水果(分类输出+重载+map)
夏天来了~~好开心啊,呵呵,好多好多水果~~Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了.输入第一行正整数N(0<N<=10)表示有N组测试数据.每组测试数据的第一行是一个整数M(0<M<=100),表示工有M次成功的交易.其后有M行数据,每行表示...原创 2019-02-21 08:55:15 · 217 阅读 · 0 评论 -
SDUT - Silver Cow Party(最短路 disjkstra)
One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1…N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A total of M (1 ≤ M ≤ 100,000) unidirectional (one-way roa...原创 2019-01-22 11:25:56 · 86 阅读 · 0 评论 -
SDUT - Heavy Transportation(最短路 disjkstra)
BackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is a way from the place his cust...原创 2019-01-22 11:22:12 · 99 阅读 · 0 评论 -
SDUT - Polycarp and Letters
题目描述Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consisting only of lowercase and uppercase Latin letters.Let A be a set of positions in the string. Let’s cal...原创 2019-01-21 09:36:24 · 144 阅读 · 0 评论 -
SDUT-汤圆の拯救计划(简单搜索 dfs)
题目描述又到了汤圆星球一年一度的汤圆节了,但是大魔王却过来把汤圆公主抓走了Σ( ° △ °|||)︴身为汤圆骑士的QAQ蒟蒻自然而然的肩负着拯救汤圆的使命QAQ蒟蒻经历了千辛万苦(并没有)之后,来到了大魔王的城堡,根据情报,汤圆公主就被大魔王放在城堡内,然后QAQ蒟蒻发现自己是一个路痴,所幸的是他拿到了大魔王的城堡的地图,而且在这上面标注了自己和汤圆公主的位置,那么问题来了,聪明的你能帮他...原创 2019-01-17 14:37:41 · 151 阅读 · 0 评论 -
SDUT-团战可以输、提莫必须死(简单搜索bfs)
题目描述为了一些你们不知道的原因,我们把LOL的地图抽象为一个n×m的矩阵提莫积攒了k个蘑菇准备种到地图上去,因为提莫的背篓漏了,所以每一个提莫走过的地方都会被摆下一个蘑菇,两个蘑菇同时种在一个地方的话就会爆炸,所以一旦即将出现这种情况,提莫会直接传送回家,防止自己被炸死之前的排位赛中因为乱种蘑菇提莫已经被骂了好多次了,所以这次提莫特地查资料对当前地图的各个位置种下蘑菇的价值做了统计,但是因...原创 2019-01-17 14:41:29 · 131 阅读 · 0 评论 -
SDUT-深度优先搜索练习之神奇的矩环(简单搜索)
题目描述小鑫的女朋友被魔王抢走了!魔王留给小鑫一张n*m大的表,上面有各种各样的颜色,用A-Z这26个字母来表示。魔王留给他一个任务,如果小鑫可以在这张表中找出任意一个长度大于1的环,并且这个环的颜色是相同的,魔王就把小鑫的女朋友还给他。为了从魔王手中夺回他的女朋友,小鑫请你帮忙,你能帮帮他吗?输入多组输入。每组的第一行有两个整数n,m。代表表的大小。接下来是由A-Z的一些字母所构成的...原创 2019-01-17 14:45:56 · 145 阅读 · 0 评论 -
SDUT-数据结构实验之图论七:驴友计划(最短路 Floyd)
题目描述做为一个资深驴友,小新有一张珍藏的自驾游线路图,图上详细的标注了全国各个城市之间的高速公路距离和公路收费情况,现在请你编写一个程序,找出一条出发地到目的地之间的最短路径,如果有多条路径最短,则输出过路费最少的一条路径。输入连续T组数据输入,每组输入数据的第一行给出四个正整数N,M,s,d,其中N(2 <= N <= 500)是城市数目,城市编号从0~N-1,M是城市间高速...原创 2019-01-17 14:49:31 · 153 阅读 · 0 评论 -
SDUT-数据结构实验之图论九:最小生成树
数目描述有n个城市,其中有些城市之间可以修建公路,修建不同的公路费用是不同的。现在我们想知道,最少花多少钱修公路可以将所有的城市连在一起,使在任意一城市出发,可以到达其他任意的城市。输入输入包含多组数据,格式如下。第一行包括两个整数n m,代表城市个数和可以修建的公路个数。(n <= 100, m <=10000)剩下m行每行3个正整数a b c,代表城市a 和城市b之间可以...原创 2019-01-17 15:11:41 · 212 阅读 · 0 评论 -
SDUT-珂朵莉与黄油面包
题目描述珂朵莉非常喜欢吃黄油面包,现在珂朵莉想吃一个大小为 d 的黄油面包,你能满足她么?输入一个正整数 d 。(1<= d <=20)输出一个高和宽均为 2*d-1 的图形,代表一个大小为 d 的黄油面包,详见样例。输入样例3输出样例#include<stdio.h>#include<string.h>int main(){ ...原创 2019-01-17 15:19:20 · 432 阅读 · 0 评论 -
SDUT-Pots(简单搜索)
题目描述You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i) empty the...原创 2019-01-18 09:52:23 · 210 阅读 · 0 评论 -
SDUT-数据结构实验之图论十一:AOE网上的关键路径(最短路 字典序)
题目描述一个无环的有向图称为无环图(Directed Acyclic Graph),简称DAG图。AOE(Activity On Edge)网:顾名思义,用边表示活动的网,当然它也是DAG。与AOV不同,活动都表示在了边上,如下图所示:如上所示,共有11项活动(11条边),9个事件(9个顶点)。整个工程只有一个开始点和一个完成点。即只有一个入度为零的点(源点)和只有一个出度为零的点(汇点)...原创 2019-01-18 11:15:43 · 228 阅读 · 1 评论 -
SDUT-Extended Traffic(spfa判断负环)
Dhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence the crowded roads, to reach destinat...原创 2019-01-23 20:05:47 · 105 阅读 · 0 评论 -
SDUT-昂贵的聘礼(最短路 spfa)
年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:“嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。“探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,...原创 2019-01-23 20:10:51 · 105 阅读 · 0 评论 -
SDUT- MPI Maelstrom(最短路)
BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee’s research advi...原创 2019-01-23 20:19:39 · 148 阅读 · 0 评论 -
C - Looooops (欧几里得+裴蜀定理)
Astronaut Natasha arrived on Mars. She knows that the Martians are very poor aliens. To ensure a better life for the Mars citizens, their emperor decided to take tax from every tourist who visited the...原创 2019-02-21 10:19:24 · 334 阅读 · 1 评论