Skip to content

githubBill/squaretown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

squaretown

minimum total travel distance (from N people) | Algorithms | C++ | manhattan grid

  • v2 C++ file reads input from file instead of command line arguments (uses array of non constant size work with g++ extension compiler)
  • original version uses dyanamic memory allocation (compatible with all c++ compilers)

*Data Input: reads from standard input a positive integer N (indicates how many students live in squaretown) and it continues by reading N pairs of positive integers x y (pair indicates the position of the student's house in the grid).

*Data Output: program prints in standard output the total traveled distance (of all the the students) in order to reach the meeting point.

Restrictions:
* 3 <= N <= 5
10^5 , 2<= M <= 10^7 (M: M horizontal and vertical roads in the grid) * Memory limit: 64 MB * Time limit: 1sec

About

minimum total travel distance (from N people) | Algorithms | C++ | manhattan grid

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages