Documente Academic
Documente Profesional
Documente Cultură
I AM VERY BUSY
You are actually very busy man. You have a big schedule of activities. Your aim is to do as much as
activities as possible.
In the given figure, if you go to date with crush, you cannot participate in the coding contest and you cant
watch the movie. Also if you play DotA, you cant study for the exam. If you study for the exam you cant
sleep peacefully. The maximum number of activities that you can do for this schedule is 3.
BusyMan_Iterative(n,go,stop) //n menyatakan jumlah aktifitas,go dan stop menyatakan interval time
int main()
1. While(n--)
2. Int test
3. //input test
4. Int i
5. For i=0 to test*2
6. //input array(i),array(i+1)
7. I+=2
8. Sort(0,test-1)
9. Return BusyMan_Recursive(0,test+1)
DICKY KAISAR UTOMO <5115100077>
1. int hasil-0
2. Int PresentFin=go+1
3. While PresentFin<=stop and array(PresentFin*2) < array(go*2+1)
4. PresentFin+=1
5. If (PresentFin<=stop)
6. Hasil=1
7. Return hasil + BusyMan_Recursive(PresentFin,stop)
8. Return hasil
Void sort(go,stop)
DOKUMENTASI
DICKY KAISAR UTOMO <5115100077>