## 10882 - Koerner's Pub

All about problems in Volume 108. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

### 10882 - Koerner's Pub

Since the range is so small (100), I thought of a bruteforce solution but that gives wrong answer.

My method:
given
A intersection B
B intersectin C
A intersectin C

find A intersectin B intersection C... right?

my code:

Code: Select all

``````  Removed after getting AC..
thanks to mf.
}
``````
Can someone give some input/output... or prove my method wrong.
Last edited by sohel on Wed Aug 10, 2005 11:33 am, edited 1 time in total.
mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:
The lower bound may be 0, for example in "34 33 33".
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York
Thanks..
.. got AC.

Sometimes it is hard to think of the obvious !!
Well, for me anyways.
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

### I/O needed.

Greetings!
Any I/O for spare?
No idea why the WA

_.
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York
How do you check whether the given data is faulty?
_.B._
Experienced poster
Posts: 160
Joined: Sat Feb 07, 2004 7:50 pm
Location: Venezuela
Contact:

### Ouch!

Ouch!, forgot to take some comments away after correction
From

Code: Select all

``low = obligatorios + (a[0] / 2); // + (a[0] % 2);``
to

Code: Select all

``low = obligatorios + (a[0] / 2) + (a[0] % 2);``
Well, had other mistake.
By the way, I considered data faulty if:
- Higher value is > than 100.
- Lower value is < than the intersection of the other 2 values.

Keep posting!
_.
lovemagic
Learning poster
Posts: 52
Joined: Thu Oct 02, 2003 11:38 am
i get WA.
can smbody plz tell me what's the output of this input?

71 60 60
72 60 60
70 60 60
72 60 6
10 10 10
34 33 33
33 35 35
0 0 1
1 1 1
34 34 34
100 100 80
80 80 100
khobaib
lovemagic
Learning poster
Posts: 52
Joined: Thu Oct 02, 2003 11:38 am
at last got AC.....

i did a mistake & that was:

i overlooked there would be some friday when Ai != Ci != Mi.
khobaib
ahm.kam_92
New poster
Posts: 4
Joined: Mon Jan 05, 2009 7:21 am

### Re: 10882 - Koerner's Pub

Hi everyone ...

It's my first time here.
i hope it's helpful

i had coded this problem and got WA ...
may anyone suggest any tricky input or check my code ?

that is my code:

Code: Select all

``````removed.
``````
Last edited by ahm.kam_92 on Mon Jan 05, 2009 9:09 pm, edited 1 time in total.
helloneo
Guru
Posts: 516
Joined: Mon Jul 04, 2005 6:30 am
Location: Seoul, Korea

### Re: 10882 - Koerner's Pub

Try this case..

Input

Code: Select all

``````12
71 60 60
72 60 60
70 60 60
72 60 6
10 10 10
34 33 33
33 35 35
0 0 1
1 1 1
34 34 34
100 100 80
80 80 100``````
My output is ..

Code: Select all

``````Case #1: Between 46 and 60 times.
Case #2: Between 46 and 60 times.
Case #3: Between 45 and 60 times.
Case #4: The records are faulty.
Case #5: Between 0 and 10 times.
Case #6: Between 0 and 33 times.
Case #7: Between 2 and 33 times.
Case #8: Between 0 and 0 times.
Case #9: Between 0 and 1 times.
Case #10: Between 1 and 34 times.
Case #11: The records are faulty.
Case #12: Between 80 and 80 times.``````
ahm.kam_92
New poster
Posts: 4
Joined: Mon Jan 05, 2009 7:21 am

### Re: 10882 - Koerner's Pub

Oops!

seems that i am stupid .. i have done this conditions to be faulty and that is wrong:

Code: Select all

``````if(min(a,b)>c){printf("Case #%d: The records are faulty.\n",i+1);continue;}
if(min(a,c)>b){printf("Case #%d: The records are faulty.\n",i+1);continue;}
if(min(b,c)>a){printf("Case #%d: The records are faulty.\n",i+1);continue;}
``````
i hope that is the only bug .. i will try it now.
Thanks very much.
ahm.kam_92
New poster
Posts: 4
Joined: Mon Jan 05, 2009 7:21 am

### Re: 10882 - Koerner's Pub

still WA

i dunno what is still wrong it is passing all the cases u have suggested.
omar_elruby
New poster
Posts: 2
Joined: Mon Jan 05, 2009 8:34 pm

### Re: 10882 - Koerner's Pub

check case 7 again, your program gives a wrong output, it's just a small mistake ...
ahm.kam_92
New poster
Posts: 4
Joined: Mon Jan 05, 2009 7:21 am

it is AC thanks