摘要:
模拟赛第二题,难度应该是倒数第三……看样例输入很晕,其实看懂了还是挺简单的,因为没有跨0点的驾驶记录要设计能PASS的测试用例的话会很痛苦……=。=DescriptionLearner drivers need to complete 50 hours of supervised driving with at least 10 hours, or more, of night driving included in the total amount. Each learner must keep a log book of their supervised driving experienc 阅读全文
摘要:
模拟赛最后一题,看懂了也是挺水的,难度算倒数第二了吧……DescriptionThe National Supermarket Chain (NSC) likes to boast that it has the lowest price for mortadella in the country. In fact, if a customer manages to find cheaper mortadella in any other chain, the NSC will match the price for that customer.Matej and Filip decided 阅读全文
摘要:
模拟赛第一题,捡分题……DescriptionIn the olden days making decisions was easy. One would get a daisy and start to pluck its petals alternating between Do-it and Do-it-Not until the last petal was reached and a decision was made.Gadget-man wants to use a computerised version. The idea is to work with a random s 阅读全文
摘要:
Description请实现一个函数,用于交换两个M * N的int类型矩阵的所有数值,其函数原型如下:void exchange(int **a, int **b, int M, int N);Hint注意:本题只需提交exchange函数的函数体,无需包含main函数以及其他部分代码,例如,只提交以下内容(仅供参考):void exchange(int **a, int **b, int M, int N){ printf("I am a student from SYSU!\n");}可以用利用多维矩阵在底层连续存储的原理,只用一层循环做(不过如果测试用例的矩阵带冗余 阅读全文
摘要:
1003. tmp DescriptionImplement the following function, which copy string from b to avoid my_strcpy(char* a, char* b)InputnoneOutputnoneHint#include <string.h>#include <stdio.h>int main(){ char str_a[100] = "123456"; char str_b[100] = "123456"; my_strcpy(str_a + 1, str 阅读全文
摘要:
Description你有一些小球,从左到右依次编号为1,2,3,...,n. 你可以执行两种指令(1或者2)。其中, 1 X Y表示把小球X移动到小球Y的左边, 2 X Y表示把小球X移动到小球Y右边。 指令保证合法,即X不等于Y。 例如,初始状态1,2,3,4,5,6的小球执行1 1 4后,小球... 阅读全文
摘要:
DescriptionThe program must switch the text lines in a backward order and split them by the middle, processing the input lines in pairs. If an empty or blank line is found, it is considered as a line but it is not printed out to the output.InputThe input will be a text file with text lines.OutputSta 阅读全文
摘要:
DescriptionN couples are standing in a circle, numbered consecutively clockwise from 1 to 2N. Husband and wife do not always stand together. We remove the couples who stand together until the circle is empty or we can't remove a couple any more. Can we remove all the couples out of the circle? I 阅读全文
摘要:
DescriptionGiven a two-dimention array whose elements are all integers,please calculate the sum of its elements,ignoring thoes who sit at the edge of the array.For example,given a 7 * 4 array,you should calculate the sum of the 5 * 2 elements.InputInput contains many test cases.For each case,the fir 阅读全文
摘要:
Description将输入的一串数中的负数延迟输出,从而分离非负数和负数 例如输入的数是: P1 N1 P2 N2 那么你处理完之后的输出应该是: P1 P2 N1 N2 注意: 非负数之间的输出顺序和输入顺序相同,负数之间的输出顺序和输入顺序也是要求相同的。Input输入有多个case: 每个case的输入有1行。每一行的第一个整数是N,代表这个输入有N个数需要处理,接下来有N个整数。Output对于每个case输出一行,这1行包括N个整数,整数之间以空格隔开。 输入以EOF结束 其实是从实验手册上改过来的题目,原题是奇数偶数分开输出,TA改成了非负数和负数分开输出,但是没改名字……于是名 阅读全文
摘要:
Description明明想在学校中请一些同学一起做一项问卷调查,为了实验的客观性,他先用计算机生成了N个1到1000之间的随机整数(N≤100),对于其中重复的数字,只保留一个,把其余相同的数去掉,不同的数对应着不同的学生的学号。然后再把这些数从小到大排序,按照排好的顺序去找同学做调查。请你协助明明完成“去重”与“排序”的工作。Input输入包含多个测试数据。每个测试数据有2行,第1行为1个正整数,表示所生成的随机数的个数N,第2行有N个用空格隔开的正整数,为所产生的随机数。Output对每个测试数据输出2行。第1行为1个正整数M,表示不相同的随机数的个数。第2行为M个用空格隔开的正整数,为 阅读全文