摘要: 题目: The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region 阅读全文
posted @ 2018-12-26 20:08 星辰大海。 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目: Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: Example 阅读全文
posted @ 2018-12-26 11:18 星辰大海。 阅读(271) 评论(0) 推荐(1) 编辑
摘要: 题目: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment which 阅读全文
posted @ 2018-12-26 10:51 星辰大海。 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 题目: The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit 阅读全文
posted @ 2018-12-26 10:50 星辰大海。 阅读(201) 评论(0) 推荐(1) 编辑
摘要: 题目: Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. Y 阅读全文
posted @ 2018-12-26 10:49 星辰大海。 阅读(170) 评论(0) 推荐(1) 编辑
摘要: 描述: Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a 阅读全文
posted @ 2018-12-26 10:48 星辰大海。 阅读(143) 评论(0) 推荐(1) 编辑
摘要: 题意: 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input: 输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开, 阅读全文
posted @ 2018-12-26 10:47 星辰大海。 阅读(264) 评论(0) 推荐(1) 编辑
摘要: 描述 在九宫格里放在1到8共8个数字还有一个是空格,与空格相邻的数字可以移动到空格的位置,问给定的状态最少需要几步能到达目标状态(用0表示空格):1 2 34 5 67 8 0 输入 输入一个给定的状态。 输出 输出到达目标状态的最小步数。不能到达时输出-1。 输入样例 1 2 34 0 67 5 阅读全文
posted @ 2018-10-17 14:24 星辰大海。 阅读(411) 评论(0) 推荐(1) 编辑
摘要: 描述: 给一个20×20的迷宫、起点坐标和终点坐标,问从起点是否能到达终点。 输入: 多个测例。输入的第一行是一个整数n,表示测例的个数。接下来是n个测例,每个测例占21行,第一行四个整数x1,y1,x2,y2是起止点的位置(坐标从零开始),(x1,y1)是起点,(x2,y2)是终点。下面20行每行 阅读全文
posted @ 2018-09-30 21:35 星辰大海。 阅读(447) 评论(0) 推荐(1) 编辑
摘要: 描述: 六一儿童节,小朋友们做踩气球游戏,气球的编号是1~100,两位小朋友各踩了一些气球,要求他们报出自己所踩气球的编号的乘积。现在需要你编一个程序来判断他们的胜负,判断的规则是这样的:如果两人都说了真话,数字大的人赢;如果两人都说了假话,数字大的人赢;如果报小数字的人说的是真话而报大数字的人说谎 阅读全文
posted @ 2018-09-30 21:33 星辰大海。 阅读(517) 评论(0) 推荐(2) 编辑