上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页
摘要: 1 /* 2 问题 根据键盘的位置向右错一位输出,其中不会出现QAZ等字符 3 解题思路 建立一个字符串常量,注意回车左边为一个',和\存储的时候要写两个\否则编译器不识别 4 */ 5 #include 6 #include 7 int main() 8 { 9 char list[]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'Z... 阅读全文
posted @ 2018-04-11 23:48 Reqaw 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 竖式问题 输入一个特定的数字集合,计算并输出所有满足要求的竖式。要求是abc*de(一个三位数乘以一个二位数)的竖式中 3 出现的所有数字均在集合中。输出时要个按照格式。 4 解题思路 首先读入数字集合,枚举每个三位数乘以每个二位数,如果满足条件输出并计数。 5 6 另外读书总结 7 int cou=0; 8 printf("%d %d %d\... 阅读全文
posted @ 2018-04-10 20:12 Reqaw 阅读(491) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 问题 输入矩阵的规模n,先将数按照下,右,上,左的顺序填入矩阵,再按照这样的顺序取出。 3 解题思路 模拟,按照笔的顺序存入取出,注意初始化的时候一定将矩阵全部初始化。 4 */ 5 #include 6 #include 7 const int N=1001; 8 int a[N][N],b[N][N]; 9 int main() 10 { 11 i... 阅读全文
posted @ 2018-04-10 19:05 Reqaw 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://cn.vjudge.net/problem/UVA-11134 1 /* 2 问题 输入棋盘的规模和车的数量n(1=<n<=5000),接着输入n辆车的所能在的矩阵的范围,计算并输出使得每辆车横竖都不能相互攻击 3 的摆放方法,能则输出每辆车的坐标,不能则输出"IMPOS 阅读全文
posted @ 2018-04-09 11:53 Reqaw 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://vjudge.net/problem/UVA-11054 1 /* 2 问题 输入村庄的个数n(2=<n<=100000)和n个村庄的数值,正代表买酒,负代表卖酒,k个单位的酒移动到相邻村需要k个单位的劳动力, 3 计算并输出至少需要多少个劳动力 4 解题思路 模拟,每个 阅读全文
posted @ 2018-04-08 20:21 Reqaw 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://cn.vjudge.net/problem/POJ-2785 The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how 阅读全文
posted @ 2018-04-07 15:30 Reqaw 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://cn.vjudge.net/problem/UVA-1605#author=0 1 /* 2 问题 设计一个包含若干层的联合国大厦,其中每一层都是等大的网格,每个格子分配给一个国家,使得任意两个不同的国家 3 都有一对相邻的格子,也就是说要么同层中有公共边的格子,要么是相 阅读全文
posted @ 2018-04-07 15:25 Reqaw 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 问题描述 AOA非常喜欢阅读莎士比亚的诗,莎士比亚的诗中有种无形的魅力吸引着他!他认为莎士比亚的诗中之所以些的如此传神,应该是他的构词非常好!所以AOA想知道,在莎士比亚的书中,每个单词出现的频率各是多少? 输入 输入一个单词列表,每行一个单词,每个单词的长度不会超过30,单词的种类不会超过1000 阅读全文
posted @ 2018-04-03 19:16 Reqaw 阅读(322) 评论(0) 推荐(0) 编辑
摘要: Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For inst 阅读全文
posted @ 2018-04-03 18:07 Reqaw 阅读(270) 评论(0) 推荐(0) 编辑
摘要: Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or 阅读全文
posted @ 2018-04-03 11:52 Reqaw 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 首先需要说明的是BFS算法(广度优先算法)本质上也是枚举思想的一种体现,本身效率不是很高,当数据规模很小的时候还是可以一试的。其次很多人可能有这样的疑问,使用搜索算法的时候,到底选用DFS还是BFS,博主觉得对于最短路搜索来说是都可以的,数据规模不大,广搜解决最短路的效率要高一些,还有对于搜索过程中 阅读全文
posted @ 2018-03-28 21:09 Reqaw 阅读(2377) 评论(0) 推荐(0) 编辑
摘要: 蚂蚁感冒 时间限制:1.0s 内存限制:256.0MB 问题描述 长100厘米的细长直杆子上有n只蚂蚁。它们的头有的朝左,有的朝右。 每只蚂蚁都只能沿着杆子向前爬,速度是1厘米/秒。 当两只蚂蚁碰面时,它们会同时掉头往相反的方向爬行。 这些蚂蚁中,有1只蚂蚁感冒了。并且在和其它蚂蚁碰面时,会把感冒传 阅读全文
posted @ 2018-03-26 20:29 Reqaw 阅读(936) 评论(0) 推荐(0) 编辑
摘要: 题目链接: https://vjudge.net/problem/UVA-10305#author=goodlife2017 题目描述 John有n个任务,但是有些任务需要在做完另外一些任务后才能做。 输入 输入有多组数据,每组数据第一行有两个整数1 <= n <= 100 和 m。n是任务个数(标 阅读全文
posted @ 2018-03-24 20:46 Reqaw 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 算法提高 士兵排队问题 时间限制:1.0s 内存限制:256.0MB 试题 有N个士兵(1≤N≤26),编号依次为 A,B,C,…,队列训练时,指挥官要把一些士兵从高到矮一次排成一行,但现在指挥官不能直接获得每个人的身高信息,只能获得“P1比P2高”这样的比较 结果(P1、P2∈A,B,C,…,Z, 阅读全文
posted @ 2018-03-24 20:41 Reqaw 阅读(1431) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2829 题目描述: Mike is very lucky, as he has two beautiful numbers, 3 and 5. But he is 阅读全文
posted @ 2018-03-11 12:13 Reqaw 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2818 题目描述: Given positive integers B and N, find an integer A such that AN is as cl 阅读全文
posted @ 2018-03-11 12:11 Reqaw 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2744 题目描述: A regular palindrome is a string of numbers or letters that is the same 阅读全文
posted @ 2018-03-11 12:04 Reqaw 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2724 题目描述: Message queue is the basic fundamental of windows system. For each proce 阅读全文
posted @ 2018-03-11 12:00 Reqaw 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2723 题目描述: Prime Number Definition An integer greater than one is called a prime nu 阅读全文
posted @ 2018-03-11 11:58 Reqaw 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2722 题目描述: Our school is planning to hold a new exciting computer programming conte 阅读全文
posted @ 2018-03-11 11:55 Reqaw 阅读(250) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页