Calculates the difference set of two sets--sixth phase Power8 algorithm challenge

Source: Internet
Author: User

Sixth issue of Power8 Competition 1.1 contest title

  Topic:
Calculates the difference set of two sets;

  Detailed Description:
There are set A and b two large sets of sets, solving the difference between set A and B (in a, but none of the elements in B), and save the result in Set C, requires the elements in the set C ascending.

The input is two files, A.txt,b.txt, one value per line, and unordered. The result is output to C.txt, which is the difference set of the input file, one value in a row, and the result is ordered in ascending order.

  Consider the point:
(1) The set of large number of sets seeking difference;
(2) Big data set sorting;

  Topic Examples:
For example, if the collection a={5,20,10,15,25,30}, set b={15,5,35,25}, completes the calculation a={10,20,30}.

1.2 Program function requirements

(1) Three parameters are passed in when the program executes (the input and output files are in the same directory as the executable file):
1) Parameter one: input file./a.txt path;
2) Parameter two: input file./b.txt path;
3) parameter three: output file./c.txt path;
(2) program run results must be output to a file./c.txt, file format requirements:
1) one row value;
2) The difference set must be arranged in ascending order;
(3) The program screen directly prints three lines of information, the form is as follows:
Num:xx
Max:num1
Min:num2
Num is the number of difference sets, max difference concentration maximum, min is the minimum value of the difference concentration;
Examples: For example, when set a={5,20,10,15,25,30}, set b={15,5,35,25}, the screen output shape is as follows:
Num:3
Max:30
Min:10

1.3 Packaging requirements for work

(1) Procedure source code;
(2) The executable file generated by the author himself and named Csdn;
(3) Program compiler shell script make.sh: Execute this compilation script, you can generate executable file csdn in the current directory;
(4) Executable execution shell script run.sh: Execute three times csdn (executable file) consecutively, and get time with each time command;
(5) Description document Readme.txt The following information:
1) program compilation instructions;
2) program operation instructions;
3) The average time that the author performs three times in succession;
4) The design of the program, as far as possible in a structured manner;
(6) When executing the run.sh script, the time must correspond to the average time in the description file readme.txt.

1.4 Verification Process Description

(1) The procedure function must meet 1.2 said, otherwise the procedure is sentenced to be unqualified;
(2) The program packaging must meet the 1.3 described, otherwise unable to carry out normal program verification, sentenced to unqualified;
(3) The average time provided by the author and the document Readme.txt is for reference only, and the time is subject to the calibration time;
(4) Procedure Verification procedure Description:
1) Check the author, the screen output is correct, if the next step is correct;
2) Direct execution run.sh get three execution time, that is, using the executable file provided by the author Csdn to carry out;
3) Delete csdn executable file, execute make.sh, execute run.sh script, get three execution time;
4) Check if there are output files C.txt, get C.txt and standard results to verify;
5) If the output checksum is correct, the average time obtained by step (3) is the final work check time;

Calculates the difference set of two sets--sixth phase Power8 algorithm challenge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.