自定义博客皮肤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)
  • 收藏
  • 关注

原创 A1112 Stucked Keyboard (20)

A1112 Stucked Keyboard (20)#include<cstdio>#include<algorithm>#include<vector>#include<cstring>using namespace std;const int maxk = 1300;const int maxn = 300;int K;char s1[maxk], s2[maxk];//bool isPrint[maxn] = {false};

2020-06-12 11:39:56 125

原创 1017 Queueing at Bank (25point(s))

1017 Queueing at Bank (25point(s))#include<cstdio>#include<algorithm>using namespace std;const int maxn = 10010;const int maxk = 110;int N, K;struct Node{ int hh,mm,ss; int time; int process;}customer[maxn];bool cmp(Node a, Node

2020-05-17 20:28:11 132

原创 A1007 Maximum Subsequence Sum (25point(s))

A1007 Maximum Subsequence Sum (25point(s))#include<cstdio>#include<algorithm>using namespace std;const int maxn = 10010;int K;int dp[maxn], s[maxn], a[maxn];int main(){ bool fla...

2020-05-06 15:33:52 119

原创 A1006 Sign In and Sign Out (25point(s))

A1006 Sign In and Sign Out (25point(s))#include<cstdio>#include<algorithm>using namespace std;const int maxm = 1000;int M;struct Node{ char ID[20]; int InTime; int OutTime;} n...

2020-05-02 14:02:27 1075

原创 A1004 Counting Leaves (30point(s))

A1004 Counting Leaves (30point(s))#include<cstdio>#include<algorithm>#include<vector>#include<queue> using namespace std;const int maxn = 101;int N, M;struct Node{ ve...

2020-04-30 22:14:29 91

原创 1004 Counting Leaves (30 分)

A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts w...

2019-09-07 17:56:59 80

原创 09-排序3 Insertion or Heap Sort (25 分)

According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, ...

2019-09-05 14:49:45 85

原创 08-图8 How Long Does It Take (25 分)

Given the relations of all the activities of a project, you are supposed to find the earliest completion time of the project.Input Specification:Each input file contains one test case. Each case sta...

2019-09-03 19:37:55 148

原创 06-图2 Saving James Bond - Easy Version (25 分)

This time let us consider the situation in the movie “Live and Let Die” in which James Bond, the world’s most famous spy, was captured by a group of drug dealers. He was sent to a small piece of land ...

2019-08-30 13:18:34 112

原创 11-散列4 Hashing - Hard Version (30 分)

Given a hash table of size N, we can define a hash function H(x)=x%N. Suppose that the linear probing is used to solve collisions, we can easily obtain the status of the hash table with a given sequen...

2019-08-30 07:58:46 439

原创 10-排序6 Sort with Swap(0, i) (25 分)

Given any permutation of the numbers {0, 1, 2,…, N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2, ...

2019-08-29 15:22:50 150

原创 09-排序2 Insert or Merge (25 point(s))

According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input data, ...

2019-08-25 07:34:12 105

原创 11-散列1 电话聊天狂人 (25 分)

给定大量手机用户通话记录,找出其中通话次数最多的聊天狂人。输入格式:输入首先给出正整数N(≤10​5​​ ),为通话记录条数。随后N行,每行给出一条通话记录。简单起见,这里只列出拨出方和接收方的11位数字构成的手机号码,其中以空格分隔。输出格式:在一行中给出聊天狂人的手机号码及其通话次数,其间以空格分隔。如果这样的人不唯一,则输出狂人中最小的号码及其通话次数,并且附加给出并列狂人的人数...

2019-08-24 17:40:30 159

原创 07-图4 哈利·波特的考试 (25 分)

哈利·波特要考试了,他需要你的帮助。这门课学的是用魔咒将一种动物变成另一种动物的本事。例如将猫变成老鼠的魔咒是haha,将老鼠变成鱼的魔咒是hehe等等。反方向变化的魔咒就是简单地将原来的魔咒倒过来念,例如ahah可以将老鼠变成猫。另外,如果想把猫变成鱼,可以通过念一个直接魔咒lalala,也可以将猫变老鼠、老鼠变鱼的魔咒连起来念:hahahehe。现在哈利·波特的手里有一本教材,里面列出了所有...

2019-08-23 12:06:10 108

原创 07-图6 旅游规划 (25 分)

有了一张自驾旅游路线图,你会知道城市间的高速公路长度、以及该公路要收取的过路费。现在需要你写一个程序,帮助前来咨询的游客找一条出发地和目的地之间的最短路径。如果有若干条路径都是最短的,那么需要输出最便宜的一条路径。输入格式:输入说明:输入数据的第1行给出4个正整数N、M、S、D,其中N(2≤N≤500)是城市的个数,顺便假设城市的编号为0~(N−1);M是高速公路的条数;S是出发地的城市编号;...

2019-08-23 12:03:42 172

空空如也

空空如也

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

TA关注的人

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