摘要: P is a permutation of the integers from 1 to N(index starting from 1). Here is the code of Bubble Sort in C++. After the sort, the array is in increas 阅读全文
posted @ 2017-08-16 08:26 西北会法语 阅读(186) 评论(0) 推荐(0) 编辑
摘要: You are given an N × N matrix. At the beginning every element is 0. Write a program supporting 2 operations: 1. Add x y value: Add value to the elemen 阅读全文
posted @ 2017-08-16 08:24 西北会法语 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 二维平面上N个点之间共有C(n,2)条连线。求这C(n,2)条线中斜率小于0的线的数量。 二维平面上的一个点,根据对应的X Y坐标可以表示为(X,Y)。例如:(2,3) (3,4) (1,5) (4,6),其中(1,5)同(2,3)(3,4)的连线斜率 < 0,因此斜率小于0的连线数量为2。 Inp 阅读全文
posted @ 2017-08-16 08:23 西北会法语 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 应教学安排,yy又去开心的做电学实验了。实验的内容分外的简单一串按钮通过编程了的EEPROM可以控制一串彩灯。然而选择了最low的一种一对一的控制模式,并很快按照实验指导书做完实验的yy马上感觉到十分无趣。于是他手指在一排按钮上无聊的滑来滑去,对应的彩灯也不断的变化着开关。已知每一个按钮按下会改变对 阅读全文
posted @ 2017-08-16 08:21 西北会法语 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star 阅读全文
posted @ 2017-08-16 08:18 西北会法语 阅读(142) 评论(0) 推荐(0) 编辑
摘要: In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacen 阅读全文
posted @ 2017-08-16 08:14 西北会法语 阅读(106) 评论(0) 推荐(0) 编辑