程序提交方法,务必看清楚步骤!1、每个人在自己的计算机上编写调试好程序后,双击桌面上的“程序设计大赛”快捷键,弹出如下对话框,在Name和password编辑框均输入自己的组号2、输入在Name和password后,点击login登录,出现如下对话框:在problem下拉列表框选择自己要提交哪个程序的源代码→在language下拉列表框选择自己编写程序所用的语言→在Main file下拉列表框选择自己源代码文件(所有的源代码务必写在一个文件里!!)→点击submit按钮提交!提交后系统会给出一个结果例如:Yes正确(简单称ac)No-Compilition Error 为编译错误简单称(ce)No-Run-time Error 运行中意外终止(RE)(也有可能是格式错误)No-time-limit Exceeded程序运行超时(TLE)No-Wrong Answer 答案错误No-Excessive Out put 程序输出结果超出pc^2所能检测的范围No-Output Format Error 格式错误No-Other-Contact Staff 其他未知错误注意:1、务必严格按照题目的要求编写程序(主要指输入文件名和输出文件名),程序使用的数据从文件中读取,运行结果写到文件里,即不能使用Scanf、Printf等标准的输入输出函数2、打开文件时只需文件名+扩展名,不能用绝对路径即不能有盘符路径!重庆理工大学第四届大学生程序设计大赛题目试题1:【旋转矩阵】【问题描述】数学上有一种矩阵叫旋转矩阵,非常的有意思,所谓旋转矩阵,就是在N阶矩阵中,起始数1置于方阵的左上角,然后从起始数开始依次递增,按顺时针方向从外向里旋转填数而成。
【输入】输入文件名“matrix.in”输入文件由一行或多行构成,每行由一个正整数N组成,(N不大于100)。
输入文件的最后一行是‘#’表示文件结束。
【输出】输出文件名“estdout.pc2”对于每一组数据,输出一个N阶的旋转矩阵。
两组输出之间不要额外的空行。
矩阵中同一行的数字用一个空格分开。
程序运行后结果示例:【样例输入】5#【样例输出】1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12 11 10 9试题2:【单词问题】【问题描述】给出一个完整的句子,这个句子中不包含不可见字符或者空格,于是在这个句子中有许多不同的单词。
一个单词是指一串连续的最长的英文字母(大写或小写)。
例如"#abc#"中,"abc"就是一个单词,而"ab","bc"都不算单词。
【输入】输入文件名“word.in”输入一个句子,只包含可见字符(不包含空格)。
句子长度不超过100。
【输出】输出文件名“estdout.pc2”按单词出现的顺序输出不同的单词。
如果一个单词出现多次则只有第一次出现时输出。
程序运行后结果示例:【样例输入】Wa_Study_Wa_Everyday_Wa_Daxia【样例输出】WaStudyEverydayDaxia试题3:【罗马数字】【问题描述】古罗马帝国开创了辉煌的人类文明,但他们的数字表示法的确有些繁琐,尤其在表示大数的时候,现在看起来简直不能忍受,所以在现代很少使用了。
之所以这样,不是因为发明表示法的人的智力的问题,而是因为一个宗教的原因,当时的宗教禁止在数字中出现0的概念!罗马数字的表示主要依赖以下几个基本符号:I 1V 5X 10L 50C 100D 500M 1000这里,我们只介绍一下1000以内的数字的表示法。
单个符号重复多少次,就表示多少倍。
最多重复3次。
比如:CCC表示300 XX表示20,但这个规则仅适用于I X C M,150并不用LLL表示。
如果相邻级别的大单位在左,小单位在右,表示大单位加上小单位,如XI表示11;如果相邻级别的大单位在右,小单位在左,表示大单位中扣除小单位。
比如:IX表示9,IV表示4 ,XL表示40,更多的示例参见下表,你找到规律了吗?I,1II,2 III,3 IV,4 V,5 VI,6 VII,7 VIII,8 IX,9 X,10 XI,11 XII,12 XIII,13 XIV,14 XV,15 XVI,16 XVII,17 XVIII,18XIX,19XX,20XXI,21XXII,22XXIX,29XXX,30XXXIV,34XXXV,35XXXIX,39XL,40L,50LI,51LV,55LX,60LXV,65LXXX,80XC,90XCIII,93XCV,95XCVIII,98XCIX,99C,100CC,200CCC,300CD,400D,500DC,600DCC,700DCCC,800CM,900CMXCIX,999【输入】输入文件名“RomanNumber.in”第一行是整数n,表示接下来有n个罗马数字(n<100)。
以后每行一个罗马数字。
罗马数字大小不超过999。
【输出】输出文件名“estdout.pc2”要求程序输出n行,就是罗马数字对应的十进制数据。
程序运行后结果示例:【样例输入】3LXXXXCIIIDCCII【样例输出】8093702二值图像是由黑白两种像素组成的矩形点阵,图像识别的一个操作是求出图像中最大黑区域的面积。
请设计一个程序完成二值图像的这个操作。
黑区域由黑像素组成,一个黑区域中的每个像素至少与该区域中的另一个像素相邻,规定一个像素仅与其上、下、左、右的像素相邻。
两个不同的黑区域没有相邻的像素。
一个黑区域的面积是其所包含的像素的个数。
【输入】输入文件名“area.in”输入由多个测试例组成。
每个测试例的第一行含两个整数n和m, (1 <=n,m<=100), 分别表示二值图像的行数与列数,后面紧跟着n行,每行含m个整数0或1,其中第i行表示图像的第i行的m个像素,0表示白像素,1表示黑像素。
同一行的相邻两个整数之间用一个空格隔开,两个测试例之间用一个空行隔开,最后一个测试例之后隔一个空行,再接的一行含有两个整数0,标志输入的结束。
【输出】输出文件名“estdout.pc2”每个测试例对应一行输出,含一个整数,表示相应的图像中最大黑区域的面积。
程序运行后结果示例:【样例输入】5 60 1 1 0 0 11 1 0 1 0 10 1 0 0 1 00 0 0 1 1 11 0 1 1 1 04 60 1 1 0 0 11 1 1 1 0 10 1 0 1 1 00 0 0 1 1 10 0【样例输出】712程序运行后结果示例:【样例输入】2STARTC Tiny 1000000000C Lina 0QGQENDSTARTQC ccQ 200C cxw 100QGQC wzc 500QEND【样例输出】1000000000-1200100500试题6:【数字游戏】丁丁最近沉迷于一个数字游戏之中。
这个游戏看似简单,但丁丁在研究了许多天之后却发觉原来在简单的规则下想要赢得这个游戏并不那么容易。
游戏是这样的,在你面前有一圈整数(一共n个),你要按顺序将其分为m个部分,各部分内的数字相加,相加所得的m个结果对10取模后再相乘,最终得到一个数k。
游戏的要求是使你所得的k最大或者最小。
例如,对于下面这圈数字(n=4,m=2):当要求最小值时,((2-1) mod 10)×((4+3) mod 10)=1×7=7,要求最大值时,为((2+4+3) mod10)×(-1 mod 10)=9×9=81。
特别值得注意的是,无论是负数还是正数,对10取模的结果均为非负值。
丁丁请你编写程序帮他赢得这个游戏。
【输入】输入文件名“game.in”输入文件第一行有两个整数,n(1≤n≤50)和m(1≤m≤9)。
以下n行每行有个整数,其绝对值不大于104,按顺序给出圈中的数字,首尾相接。
【输出】输出文件名“estdout.pc2”输出文件有两行,各包含一个非负整数。
第一行是你程序得到的最小值,第二行是最大值。
【样例输入】4 243-12【样例输出】781试题7:【Is It A Tree? 】A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying the following properties.1. There is exactly one node, called the root, to which no directed edges point.2. Every node except the root has exactly one edge pointing to it.3. There is a unique sequence of directed edges from the root to each node.For example, consider the illustrations below, in which nodes are represented by circles and edges are represented by lines with arrowheads. The first two of these are trees, but the last is not.In this problem you will be given several descriptions of collections of nodes connected by directed edges. For each of these you are to determine if the collection satisfies the definition of a tree or not.InputThe input will consist of a sequence of descriptions (test cases) followed by a pair of negative integers. Each test case will consist of a sequence of edge descriptions followed by a pair of zeroes Each edge description will consist of a pair of integers; the first integer identifies the node from which the edge begins, and the second integer identifies the node to which the edge is directed. Node numbers will always be greater than zero.OutputFor each test case display the line "Case k is a tree." or the line "Case k is not a tree.", where k corresponds to the test case number (they are sequentially numbered starting with 1).【Sample Input】Input filename:“trees.in”6 8 5 3 5 2 6 45 6 0 08 1 7 3 6 2 8 9 7 57 4 7 8 7 6 0 03 8 6 8 6 45 3 56 5 2 0 0-1 -1【Sample Output】Output filename:“estdout.pc2”Case 1 is a tree.Case 2 is a tree.Case 3 is not a tree.试题8:【Coconuts, Revisited】The short story titled Coconuts, by Ben Ames Williams, appeared in the Saturday Evening Post on October 9, 1926. The story tells about five men and a monkey who were shipwrecked on an island. They spent the first night gathering coconuts. During the night, one man woke up and decided to take his share of the coconuts. He divided them into five piles. One coconut was left over so he gave it to the monkey, then hid his share and went back to sheep.Soon a second man woke up and did the same thing. After dividing the coconuts into five piles, one coconut was left over which he gave to the monkey. He then hid his share and went back to bed. The third, fourth, and fifth man followed exactly the same procedure. The next morning, after they all woke up, they divided the remainingcoconuts into five equal shares. This time no coconuts were left over.An obvious question is "how many coconuts did they originally gather?" There are an infinite number of answers, but the lowest of these is 3,121. But that's not our problem here.Suppose we turn the problem around. If we know the number of coconuts that were gathered, what is the maximum number of persons (and one monkey) that could have been shipwrecked if the same procedure could occur?InputThe input will consist of a sequence of integers, each representing the number of coconuts gathered by a group of persons (and a monkey) that were shipwrecked. The sequence will be followed by a negative number.OutputFor each number of coconuts, determine the largest number of persons who could have participated in the procedure described above. Display the results similar to the manner shown below, in the Expected Output. There may be no solution for some of the input cases; if so, state that observation.【Sample Input】Input filename:“Coconuts.in”25303121-1【Sample Output】Output filename:“estdout.pc2”25 coconuts, 3 persons and 1 monkey30 coconuts, no solution3121 coconuts, 5 persons and 1 monkey第11 页共11 页。