Skip to content

RanderDouble/ADSProject5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Three Partition

Test method

cd to code/ use cmake to compile the project or you can cd to code/test/ to run the test scripts If you just run the scripts, you can use -f to redirect the input and the output to testcase/ for debug

Problem Description

You have a very simple task: just partition a series of numbers into three parts and make their sum is the same.

More formally, you will first get a positive integer N indicating that there will be totally N numbers as follow. And then you will get N positive integers $a_1$, $a_2$, ⋯, $a_n$, you should calculate whether there is a three - partition that can partition them into three parts and their sum is exactly the same, if the answer is yes, you also need to output the 3 parts in 3 lines.

bonus: If partition these numbers into 4,5,⋯,k(k is a given number but not a input) parts, do you r above different types of algorithm also work? If not work, can you try some new type of algorithm to solve it? If work, Can you analyze the time complexity of them?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •