1. 程式人生 > >計算幾何-點、線、面、形

計算幾何-點、線、面、形

put strong 玩具 determine 描述 stay 垃圾箱 mom lap

1.TOYS

雙語描述:

技術分享圖片
Calculate the number of toys that land in each bin of a partitioned toy box.
計算一個分區玩具箱每個箱子裏的玩具數量。
Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave John a rectangular box to put his toys in, but John is rebellious and obeys his parents by simply throwing his toys into the box. All the toys get mixed up, and it is impossible for John to find his favorite toys.
媽媽和爸爸有一個問題-他們的孩子約翰從來沒有把他的玩具,當他結束了與他們玩。他們給約翰一個長方形的盒子,把他的玩具放在裏面,但是約翰很叛逆,服從他的父母,只是把他的玩具扔到盒子裏。所有的玩具都搞混了,約翰不可能找到他最喜歡的玩具。
John‘s parents came up with the following idea. They put cardboard partitions into the box. Even if John keeps throwing his toys into the box, at least toys that get thrown into different bins stay separated. The following diagram shows a top view of an example toy box.
約翰的父母想出了如下主意。他們在盒子裏放了硬紙板隔板。即使約翰不停地把玩具扔到盒子裏,至少把玩具扔進不同的垃圾箱會被分開。下圖顯示了示例玩具盒的俯視圖。
For this problem, you are asked to determine how many toys fall into each partition as John throws them into the toy box.
對於這個問題,你被要求確定有多少玩具落入每個分區,當約翰把它們扔到玩具盒裏時。
View Code

計算幾何-點、線、面、形