自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

原创 1036 Boys vs Girls (25 分)

1036Boys vs Girls(25分)This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:Eac...

2019-04-23 17:08:47 253

原创 1031 Hello World for U (20 分)

1031Hello World for U(20分)Given any string ofN(≥5) characters, you are asked to form the characters into the shape ofU. For example,helloworldcan be printed as:h de ll rlowoThat i...

2019-04-23 17:03:44 230

原创 1020 Tree Traversals (25 分)

1020Tree Traversals(25分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order ...

2019-04-09 16:37:16 527

原创 1051 Pop Sequence (25 分)

1051Pop Sequence(25分)Given a stack which can keepMnumbers at most. PushNnumbers in the order of 1, 2, 3, ...,Nand pop randomly. You are supposed to tell if a given sequence of numbers is a ...

2019-04-01 22:18:23 294

原创 1053 Path of Equal Weight (30 分)

1053Path of Equal Weight(30分)Given a non-empty tree with rootR, and with weightW​i​​assigned to each tree nodeT​i​​. Theweight of a path fromRtoLis defined to be the sum of the weights o...

2019-03-31 16:59:12 601

原创 1030 Travel Plan (30 分)

1030Travel Plan(30分)A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to d...

2019-03-27 20:42:11 197

原创 1003 Emergency (25 分)

1003Emergency(25分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams...

2019-03-21 16:35:01 239

原创 1076 Forwards on Weibo (30 分)

1076Forwards on Weibo(30分)Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed wi...

2019-03-15 22:13:20 99

原创 1021 Deepest Root (25 分)

1021Deepest Root(25分)A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a ...

2019-03-13 13:47:19 256

原创 1013 Battle Over Cities (25 分)

1013Battle Over Cities(25 分)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 city are closed. We...

2019-03-12 16:29:40 258

原创 1034 Head of a Gang (30 分)

1034Head of a Gang(30 分)One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call betweenAandB, we say thatAandBis related. The weight of a...

2019-03-12 15:16:57 309

原创 1061 判断题 (15 分)

1061 判断题 (15 分)判断题的评判很简单,本题就要求你写个简单的程序帮助老师判题并统计学生们判断题的得分。输入格式:输入在第一行给出两个不超过 100 的正整数 N 和 M,分别是学生人数和判断题数量。第二行给出 M 个不超过 5 的正整数,是每道题的满分值。第三行给出每道题对应的正确答案,0 代表“非”,1 代表“是”。随后 N 行,每行给出一个学生的解答。数字间均以空格分隔...

2018-12-26 17:06:15 276

原创 1089 狼人杀-简单版 (20 分)(枚举)

1089 狼人杀-简单版 (20 分)以下文字摘自《灵机一动·好玩的数学》:“狼人杀”游戏分为狼人、好人两大阵营。在一局“狼人杀”游戏中,1 号玩家说:“2 号是狼人”,2 号玩家说:“3 号是好人”,3 号玩家说:“4 号是狼人”,4 号玩家说:“5 号是好人”,5 号玩家说:“4 号是好人”。已知这 5 名玩家中有 2 人扮演狼人角色,有 2 人说的不是实话,有狼人撒谎但并不是所有狼人都在...

2018-12-25 16:25:07 300

原创 1052 卖个萌 (20 分)

1052 卖个萌 (20 分)萌萌哒表情符号通常由“手”、“眼”、“口”三个主要部分组成。简单起见,我们假设一个表情符号是按下列格式输出的:[左手]([左眼][口][右眼])[右手]现给出可选用的符号集合,请你按用户的要求输出表情。输入格式:输入首先在前三行顺序对应给出手、眼、口的可选符号集。每个符号括在一对方括号 []内。题目保证每个集合都至少有一个符号,并不超过 10 ...

2018-12-24 22:06:05 1008

原创 马走日(深度优先搜索)

002:马走日题目链接:http://cxsjsxmooc.openjudge.cn/2017t2summerfinal/002/总时间限制:1000ms内存限制:1024kB描述马在中国象棋以日字形规则移动。请编写一段程序,给定n*m大小的棋盘,以及马的初始位置(x,y),要求不能重复经过棋盘上的同一个点,计算马可以有多少途径遍历棋盘上的所有点。输入第一行...

2018-11-29 20:26:37 1921

原创 大盗阿福(动态规划)

001:大盗阿福题目链接:http://cxsjsxmooc.openjudge.cn/2017t2summerfinal/001/总时间限制:1000ms内存限制:65536kB描述阿福是一名经验丰富的大盗。趁着月黑风高,阿福打算今晚洗劫一条街上的店铺。这条街上一共有 N 家店铺,每家店中都有一些现金。阿福事先调查得知,只有当他同时洗劫了两家相邻的店铺时,街上的报...

2018-11-29 15:59:59 291

原创 ~scanf()和scanf()!=EOF

两者作用是相同的。~是按位取反scanf的返回值是输入值的个数如果没有输入值就是返回-1-1按位取反结果是0while(~scanf("%d", &n))就是当没有输入的时候退出循环 EOF,为End Of File的缩写,通常在文本的最后存在此字符表示资料结束。EOF 的值通常为 -1 ...

2018-11-28 12:04:23 16493 2

原创 Tian Ji -- The Horse Racing(贪心)

Tian Ji -- The Horse Racing Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 38193    Accepted Submission(s): 11464   Problem De...

2018-11-28 11:46:13 190

原创 Radar Installation(贪心+区间)

Radar InstallationTime Limit: 1000MS   Memory Limit: 10000K Total Submissions: 112280   Accepted: 24755 DescriptionAssume the coasting is an infinite straight line. Land is in one ...

2018-11-27 21:42:29 1067

原创 Gone Fishing(枚举+贪心)

Gone Fishing时间限制:3000 ms  |  内存限制:65535 KB难度:5描述John is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n <= 25) all reachabl...

2018-11-26 15:59:33 3448 2

原创 鸣人和佐助(含特殊的状态的BFS)

024:鸣人和佐助查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述佐助被大蛇丸诱骗走了,鸣人在多少时间内能追上他呢?已知一张地图(以二维矩阵的形式表示)以及佐助和鸣人的位置。地图上的每个位置都可以走到,只不过有些位置上有大蛇丸的手下,需要先打败大蛇丸的手下才能到这些位置。鸣人有一定数量的查克拉,每一个单位的查克拉可以打败一...

2018-11-25 16:25:36 2498 3

原创 Pots(BFS+路径记录)

023:Pots查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i)        f...

2018-11-25 16:22:26 415 1

原创 迷宫问题(BFS+路径记录)

022:迷宫问题查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述定义一个二维数组: int maze[5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁...

2018-11-25 16:14:55 915 1

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

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...

2018-11-08 23:01:40 106

原创 06-图1 列出连通集 (25 分)

 06-图1 列出连通集 (25 分)给定一个有N个顶点和E条边的无向图,请用DFS和BFS分别列出其所有的连通集。假设顶点从0到N−1编号。进行搜索时,假设我们总是从编号最小的顶点出发,按编号递增的顺序访问邻接点。输入格式:输入第1行给出2个整数N(0<N≤10)和E,分别是图的顶点数和边数。随后E行,每行给出一条边的两个端点。每行中的数字之间用1空格分隔。输出格式:...

2018-11-08 22:56:11 248

原创 程序设计与算法(二)第八周测验 3:棋盘问题

3:棋盘问题查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。输入输入含有多组测试数据。每组数据的第一行是两个正整数,n k...

2018-11-06 21:04:58 578

原创 程序设计与算法(二)第八周测验 2:A Knight's Journey

2:A Knight's Journey查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述BackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make ...

2018-11-06 21:03:25 1018

原创 程序设计与算法(二)第八周测验 1:红与黑

1:红与黑查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述有一间长方形的房子,地上铺了红色、黑色两种颜色的正方形瓷砖。你站在其中一块黑色的瓷砖上,只能向相邻的黑色瓷砖移动。请写一个程序,计算你总共能够到达多少块黑色的瓷砖。输入包括多个数据集合。每个数据集合的第一行是两个整数W和H,分别表示x方向和y方向瓷砖的数量。W和H都...

2018-11-06 21:01:53 1052

原创 1002 A+B for Polynomials (25 分)

1002 A+B for 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, a...

2018-10-31 22:41:04 82

原创 1001 A+B Format (20 分)

 1001 A+B Format (20 分)Calculate a+b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input ...

2018-10-31 22:35:10 181

原创 斐波那契的兔子

 #include <stdio.h>long fun(int month){    if(month==1||month==2)    return 1;    else    return fun(month-1)+fun(month-2); }int main(){    int n,sum=0,mon=0;    scanf("%d",&n);...

2018-07-18 11:40:17 498

空空如也

空空如也

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

TA关注的人

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