JXUFE紫书第四章习题
文章平均质量分 75
JXUFE_ACMer
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
JXUFE紫书第四章习题 D 4-4
题目大意:将第二个骰子旋转,判断是否能与第一个骰子各面颜色完全相同。思路:将1号位固定,共有6种可能,且此时6号位也已固定;再将2号位固定,有4种可能,此时剩下的面颜色都已固定;所以一共有24种可能。...原创 2018-05-17 18:56:30 · 258 阅读 · 0 评论 -
习题4-6 莫尔斯电码
原题:莫尔斯电码1、此英文原题大致意思是给定一些莫尔斯编码,给定一些已知字典,给定一些编码,求解这些编码的对应原文。如果可以精确匹配,则直接输出原单词,如果有多个可精确匹配的结果,则输出匹配结果里字典序最小的单词并在末位加上“!”;如果无法精确匹配,则可以在编码的末尾增加或删除一些字符后匹配单词(增删应尽量小,就是找到增删最少的模糊匹配),无论增删后匹配一个还是多个,最后都要加上“?”;如果有多个...转载 2018-05-15 23:43:13 · 1757 阅读 · 1 评论 -
JXUFE紫书第四章习题4-7
原题描述:RAID (Redundant Array of Inexpensive Disks) is a technique which uses multiple disks to store data.By storing the data on more than one disk, RAID is more fault tolerant than storing data on a si...转载 2018-05-15 22:35:54 · 282 阅读 · 0 评论 -
JXUFE紫书第四章习题 C 4-3
#include <stdio.h>#include <string.h> const int maxn=10;char board[maxn][maxn];//棋盘信息int legal[maxn][maxn]; //落子合法位置int direction[maxn];//八个方向,"米"字形,重左横开始,顺时针方向。void printdirection(){ i...转载 2018-05-15 20:07:47 · 259 阅读 · 0 评论 -
JXUFE紫书第四章习题 A 4-1
考虑一个象棋残局,其中红方有n(2≤n≤7)个旗子,黑方只有一个将。红方除了有一个帅(G)之外还有3种可能的棋子:车(R),马(H),炮(C),并且需要考虑“蹩马腿”与将和帅不能照面(将、帅如果同在一条直线上,中间又不隔着任何棋子的情况下,先走的一方获胜)的规则。输入所有棋子的位置,保证局面合法并且红方已经将军。你的任务是判断红方是否已经把黑方将死。关于中国象棋的相关规则请参见原题。原题描述Des...转载 2018-05-15 17:50:57 · 673 阅读 · 2 评论 -
JXUFE紫书第四章习题B 4-2
#include<iostream>using namespace std;int a[10][10];int b[10][10];int judge (int len, int n) { int sum = 0, num = n/len; for (int i = 1; i < num+1; i++) for (int j = 1; j ...转载 2018-05-20 00:00:37 · 194 阅读 · 0 评论 -
JXUFE紫书第四章习题 E 4-5
Alex is administrator of IP networks. His clients have a bunch of individual IP addresses and he decided to group all those IP addresses into the smallest possible IP network.Each IP address is a 4-by...转载 2018-05-19 01:30:43 · 191 阅读 · 0 评论 -
JXUFE紫书第四章习题4-10
英文题目:To enable homebuyers to estimate the cost of flood insurance, a real-estate firm provides clients withthe elevation of each 10-meter by 10-meter square of land in regions where homes may be purch...转载 2018-05-18 16:29:43 · 300 阅读 · 0 评论 -
紫书第四章习题4_9
原题描述:Dr. Tuple is working on the new data-mining application for Advanced Commercial Merchandise Inc.One of the subroutines for this application works with two arrays P and Q containing N records of d...转载 2018-05-18 00:06:32 · 251 阅读 · 0 评论 -
JXUFE紫书第四章习题 4-8
题意:每个学生(1<=n<=10)存在一个awake-sleep周期,当这个学生到awake的最后一刻时,他要判断当前睡觉和醒的学生的人数,如果睡觉的人数绝对大于醒着的人数,那么他要继续保持清醒a分钟,否则就进入睡觉状态。给出n个学生的清醒周期和睡觉周期以及初始时刻处于周期的时刻,判断什么时刻全班同学都清醒着,如果不存在这样的时刻,那么就输出-1.分析:只需要计算每个时刻全班的清醒人数...转载 2018-05-16 19:52:18 · 251 阅读 · 0 评论
分享