1 Introduction Problem Description And If Any Background Of The Algorithms Description Given N Integers Ai And A Po 1 (48.25 KiB) Viewed 33 times
1 Introduction Problem Description And If Any Background Of The Algorithms Description Given N Integers Ai And A Po 2 (44.96 KiB) Viewed 33 times
1: Introduction Problem description and (if any) background of the algorithms. Description: Given N integers Ai and a positive integer C, how many pairs of i and j satisfying Ai- Aj=C? (给定N个整数Ai以及一个正整数C,问 ijAi-Aj-C. ) Input: In the first line, enter the integers N and C separated by two spaces. Lines 2~N+1 contain an integer Ai in each line. (第一行输入两个空格隔开的整数N和 C,第2~N+1行每行包含一个整数Ai。) Output: A number to represent the answer (输出一个数表示答案。) Sample Input 53 Sample Output 3 K21425
2: Algorithm Specification Description (pseudo-code preferred) of all the algorithms involved for solving the problem, including specifications of main data structures. 3: Testing Results Table of test cases. Each test case usually consists of a brief description of the purpose of this case, the expected result, the actual behavior of your program, the possible cause of a bug if your program does not function as expected, and the current status ("pass", or "corrected", or "pending"). 4: Analysis and Comments Analysis of the time and space complexities of the algorithms. Comments on further possible improvements. Appendix: Source Code (in C/C++) At least 30% of the lines must be commented. Otherwise the code will NOT be evaluated.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!