reading the problem description, i'm sure this is not a difficult (the soft word of easy ) problem. but now i'm look stupid coz of WA. are there special cases? can anyone help me?
[c]
--- cut GOT AC---
[/c]
Last edited by titid_gede on Tue Apr 15, 2003 5:55 am, edited 2 times in total.
Oh yes, there are 2 more things:
1. The input terminates on jumdata == 0, not sum == 0.
2. You don't need mark[] ... probably removing it from your code won't change your algorithm.
-turuthok-
The fear of the LORD is the beginning of knowledge (Proverbs 1:7).
How stupid i am... Thank you very much Pak Haryanto... muach muach...
yes i found my mark variable wont change my algo since i always start searching from the last term + 1. i really didn't realize that i should check to all result not only last result until i found case you've given. And also i have to read the problem more carefully. once again thank you very much
i'll fixed my code. Hope we can meet in Kampus Anggrek
hello titid, I try to compile your program with bc 3.1 and I got your program too much global variable, and if I reduce your allresult[500] to allresult [200], you cannot pass with first sample I/O. but I don't know, if at gcc compiler you pass or not.
but I think, your program cannot handle input like this:
Sums of 6:
NONE
Sums of 7:
7
Sums of 131:
99+30+2
99+20+10+2
99+10+10+10+2
Sums of 18:
3+3+3+3+3+3
Sums of 24:
2+2+2+2+2+2+2+2+2+2+2+2
Sums of 11:
NONE
Sums of 999:
999
I've got AC. there are small bugs in my last code, it cannot handle if there is only one result, and also in outputing results. thank you very much brother evan and brother hary.
btw how is your kpkbm03 result? after good start in semifinal, i was kicked down to 11th place, no money
to deddy: I don't know where is your mistake, because I don't know your code, but it maybe only a small mistake.
to titid: I'm failed at semifinal, because a small mistake in file he..he..he.. because that I solve problem 3 at 2 hour, and I cannot solve another problem because I very angry with myself. I hope I can try for KPKB next year.