摘要: 2754:八皇后查看提交统计提问时间限制: 1000ms内存限制: 65536kB描述会下国际象棋的人都很清楚:皇后可以在横、竖、斜线上不限步数地吃掉其他棋子。如何将8个皇后放在棋盘上(有8 * 8个方格),使它们谁也不能被吃掉!这就是著名的八皇后问题。 对于某个满足要求的8皇后的摆放方法,定义一个皇后串a与之对应,即a=b1b2...b8,其中bi为相应摆法中第i行皇后所处的列数。已经知道8皇后问题一共有92组解(即92个不同的皇后串)。给出一个数b,要求输出第b个串。串的比较是这样的:皇后串x置于皇后串y之前,当且仅当将x视为整数时比y小。输入第1行是测试数据的组数n,后面跟着n行输入。每 阅读全文
posted @ 2011-08-16 10:40 何解一直犯相同错误? 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 2767:简单密码查看提交统计提问时间限制:1000ms内存限制:65536kB描述Julius Caesar曾经使用过一种很简单的密码。对于明文中的每个字符,将它用它字母表中后5位对应的字符来代替,这样就得到了密文。比如字符A用F来代替。如下是密文和明文中字符的对应关系。密文A B C D E F G H I J K L M N O P Q R S T U V W X Y Z明文V W X Y Z A B C D E F G H I J K L M N O P Q R S T U你的任务是对给定的密文进行解密得到明文。你需要注意的是,密文中出现的字母都是大写字母。密文中也包括非字母的字符,对 阅读全文
posted @ 2011-08-16 07:01 何解一直犯相同错误? 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 2715:谁拿了最多奖学金查看提交统计提问时间限制:1000ms内存限制:65536kB描述某校的惯例是在每学期的期末考试之后发放奖学金。发放的奖学金共有五种,获取的条件各自不同:1) 院士奖学金,每人8000元,期末平均成绩高于80分(>80),并且在本学期内发表1篇或1篇以上论文的学生均可获得;2) 五四奖学金,每人4000元,期末平均成绩高于85分(>85),并且班级评议成绩高于80分(>80)的学生均可获得;3) 成绩优秀奖,每人2000元,期末平均成绩高于90分(>90)的学生均可获得;4) 西部奖学金,每人1000元,期末平均成绩高于85分(>85)的 阅读全文
posted @ 2011-08-16 07:01 何解一直犯相同错误? 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 2801:填词查看提交统计提问时间限制:1000ms内存限制:65536kB描述Alex喜欢填词游戏。填词是游戏是一个非常简单的游戏。填词游戏包括一个N * M大小的矩形方格盘和P个单词。玩家需要把每个方格中填上一个字母使得每个单词都能在方格盘上找到。每个单词都能找到要满足下面的条件:每个方格都不能同时属于超过一个的单词。一个长为k的单词一定要占据k个方格。单词在方格盘中出现的方向只能是竖直的或者水平的。你的任务是首先在方格盘上找到所有的单词,当然在棋盘上可能有些方格没有被单词占据。然后把这些没有用的方格找出来,把这些方格上的字母按照字典序组成一个“神秘单词”。如果你还不了解规则,我们可以具一 阅读全文
posted @ 2011-08-16 07:01 何解一直犯相同错误? 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 1111:Image Perimeters查看提交统计提问时间限制:1000ms内存限制:65536kB描述Technicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object. The perimeter of the boundary of an object is one useful measure. Your task is to determine this perim 阅读全文
posted @ 2011-08-16 07:00 何解一直犯相同错误? 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 2972:确定进制查看提交统计提问时间限制:1000ms内存限制:65536kB描述6*9 = 42 对于十进制来说是错误的,但是对于13进制来说是正确的。即, 6(13) * 9(13) = 42(13), 而 42(13) = 4 * 131 + 2 * 130 = 54(10)。你的任务是写一段程序读入三个整数p、q和 r,然后确定一个进制 B(2<=B<=16) [注意隐性条件,就是B要小于给定的数的各个位数]使得 p * q = r.如果 B有很多选择, 输出最小的一个。例如: p = 11, q = 11, r = 121. 则有 11(3) * 11(3) = 121 阅读全文
posted @ 2011-08-16 07:00 何解一直犯相同错误? 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 1050:To the Max查看提交统计提问时间限制:5000ms内存限制:65536kB描述Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle is the sum of all the elements in that rectangle. In this problem 阅读全文
posted @ 2011-08-16 06:59 何解一直犯相同错误? 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1018: Communication System查看提交统计提问时间限制:1000ms内存限制:65536kB描述We have received an order from Pizoor Communications Inc. for a special communication system.The system consists of several devices. For each device, we are free to choose from several manufacturers. Same devices from two manufacturersdiffer 阅读全文
posted @ 2011-08-16 06:59 何解一直犯相同错误? 阅读(690) 评论(0) 推荐(0) 编辑
摘要: 1664:放苹果查看提交统计提问时间限制:1000ms内存限制:65536kB描述把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。输入第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。输出对输入的每组数据M和N,用一行输出相应的K。样例输入17 3样例输出8查看提交统计提问//关键点是想象出从低到高的柱状型排列,并分层考虑;注意:允许有的瓶子空着不放#include<iostream>using names 阅读全文
posted @ 2011-08-16 06:58 何解一直犯相同错误? 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 1163:The Triangle查看提交统计提问时间限制:1000ms内存限制:65536kB描述738810274445265(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route thatstarts at the top and ends somewhere on the base. Each step can go either diagonally down to the left or diago 阅读全文
posted @ 2011-08-16 06:58 何解一直犯相同错误? 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 2739:计算对数查看提交统计提问时间限制:1000ms内存限制:65536kB描述给定两个正整数a和b。可以知道一定存在整数x,使得x <= logab < x + 1输出x输入第1行是测试数据的组数n,每组测试数据占2行,分别是a和b。每组测试数据之间有一个空行,每行数据不超过100个字符输出n行,每组测试数据有一行输出,也就是对应的x。输入数据保证x不大于20样例输入3100001000000000001100009999999999999999999999999999999999999999999999999999999999991样例输出320查看提交统计提问#inclu 阅读全文
posted @ 2011-08-16 06:57 何解一直犯相同错误? 阅读(320) 评论(0) 推荐(0) 编辑
摘要: 2159:Ancient Cipher查看提交统计提问时间限制:1000ms内存限制:65536kB描述Ancient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in encrypted form to prevent eavesdropping(窃听、窃取). The most popular 阅读全文
posted @ 2011-08-16 06:57 何解一直犯相同错误? 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1328:Radar Installation查看提交统计提问时间限制:1000ms内存限制:65536kB描述Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the coasting,can only cover d distance, so an is 阅读全文
posted @ 2011-08-16 06:56 何解一直犯相同错误? 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 1753:Flip Game查看提交统计提问时间限制:1000ms内存限制:65536kB描述Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the other one is black and each piece is lying either it's black or white side up.Each round you flip 3 to 5 p 阅读全文
posted @ 2011-08-16 06:56 何解一直犯相同错误? 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 2509:Peter's smokes查看提交统计提问时间限制:1000ms内存限制:65536kB描述Peter hasn cigarettes. He smokes them one by one keeping all the butts.Out of k > 1(事实上吸过的烟超过>=k即可) butts he can roll a new cigarette.How many cigarettes can Peter have?输入Input is a sequence of lines. Each line contains two integer number 阅读全文
posted @ 2011-08-16 06:55 何解一直犯相同错误? 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 1094:Sorting It All Out查看提交统计提问时间限制: 1000ms内存限制: 65536kB描述An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D implies that A < B, B < C and C < D 阅读全文
posted @ 2011-08-16 06:52 何解一直犯相同错误? 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 1258:Agri-Net查看提交统计提问时间限制:1000ms内存限制:65536kB描述Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer John ordered a high speed connection for his farm and is going to share his con 阅读全文
posted @ 2011-08-16 06:51 何解一直犯相同错误? 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 1258:Agri-Net查看提交统计提问时间限制:1000ms内存限制:65536kB描述Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He needs your help, of course.Farmer John ordered a high speed connection for his farm and is going to share his con 阅读全文
posted @ 2011-08-16 06:50 何解一直犯相同错误? 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 2790:迷宫查看提交统计提问时间限制:3000ms内存限制:65536kB描述一天Extense在森林里探险的时候不小心走入了一个迷宫,迷宫可以看成是由n * n的格点组成,每个格点只有2种状态,.和#,前者表示可以通行后者表示不能通行。同时当Extense处在某个格点时,他只能移动到东南西北(或者说上下左右)四个方向之一的相邻格点上,Extense想要从点A走到点B,问在不走出迷宫的情况下能不能办到。如果起点或者终点有一个不能通行(为#),则看成无法办到。输入第1行是测试数据的组数k,后面跟着k组输入。每组测试数据的第1行是一个正整数n(1 <= n <= 100),表示迷宫的 阅读全文
posted @ 2011-08-16 06:50 何解一直犯相同错误? 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 1256:Anagram查看提交统计提问时间限制: 1000ms内存限制: 65536kB描述You are to write aprogram that has to generate all possible words from a given set of letters. Example: Given the word "abc", your program should - by exploring alldifferent combination of the three letters - output the words "abc",& 阅读全文
posted @ 2011-08-16 04:53 何解一直犯相同错误? 阅读(284) 评论(0) 推荐(0) 编辑