×

# SPOJ EGGYPIZZA

 0 LINK TO PROBLEM : http://www.spoj.com/problems/EGYPIZZA/ i have solved above problem using frequency array but i read in comments other approaches using set,map,greedy. What are different solution to this problem? asked 21 Mar '17, 23:25 164●9 accept rate: 4%

 1 all of them wants his amount of pizza in one slice see this line, it means each friend must be given pizza as only a slice ie if someone wants 1/2 pizza, he should be given 1/2 piece as a whole rather than 2 "1/4" pieces. So algo works something like this 1. Divide pizza among people wanting 3/4 pizza with 1/4 pizza 2. Divide pizza among people wanting 1/2 pizza with 1/2 pizza 3. Divide pizza among people wanting 1/2 pizza with 2 person that wants 1/4 pizza 4. Divide pizza among 4 people if all wants 1/4 pizza 5. 1 pizza for abotrika answered 22 Mar '17, 00:30 1.1k●13 accept rate: 20% 1 I know this approach , i am looking for approach other than this (22 Mar '17, 00:40)
 0 Search your query through google. There are many different approach already discussed in codechef discussion or you will find many other blogs with good explanation. Just type EGYPIZZA - Pizza answered 21 Mar '17, 23:32 2.8k●1●4●19 accept rate: 16% I already googled it but was not able to find any solution other than frequency array. (21 Mar '17, 23:39)
 0 I am using the approach described above but my code still gives wrong answer! Can anyone help what's wrong with my code? answered 30 Nov '17, 03:05 71●6 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,138
×1,024
×61

question asked: 21 Mar '17, 23:25

question was seen: 582 times

last updated: 02 Dec '17, 22:15