← Back to topics
Topic

X-tra easy END...

s
s-lime
So, the competition is over. Here is the place to tell everything positive and negative (to prevent doing same mistakes twice)... How was it? Did you like it? Were the tasks really that easy? Do you need to comment any task? Was any task worth especial mentioning? What wasn't so good?
T
Tavo92
I think you are not used to what "easy" means in z-trening. Your contest, for me, was a bit easier than what we are used to.

Waiting for the results now :D
s
s-lime
Well, wooden doors wasn't so hard, as you just got to get the trick, then you had O(1). N-polygons - you just had to get mathematical formulas out, also O(1). Magic four was nothing special. Street bit lights, you had to use formula -log2(P), where P is probability, O(n). Periodic system - you had to do simple recursion, no more than 50 lines.
A
Amtrix
Wooden Doors ?? what's the trick???
Something like number of divisor or what??? :S
o
ortschun
the thing i dont get here is why do we need more than 3 bits for 3 lamps?
g
gates
Yes, you can see that door X will be open only if X has odd number of divisors. Numbers with odd number of divisors are only perfect squares.
A
Amtrix
Thx gates, now i've learned something new :D
even number of divisors = perfekt square
I made simply brute force :S
s
s-lime
Yes, wooden doors has 3 line solution :P But don't tell everything, let's spare the fun for next generation.
@ortschun: In case the light was on and expectation was 1%, you get -log2(0.01)=6,64 bit of information. So therefore, it was possible to get even 18 bit for 3 lamps.
g
gates
@Amtrix.
proof is very simple.

X = p1^t1 + p2^t2 + .. pn^an
is prime factorization of x, and all pi-s are different.

probably you now then that number of divisors of x is:
( t1 + 1 ) * ( t2 + 1 ) * ... * ( tn + 1 )

so suppose that X has odd number of divisors then all brackets in this product must be odd.

so then all t1, t2..tn are even. ( because ( ti+1 ) is odd )

and if all t1, t2 .. tn are even then X is a perfect square.
T
Tavo92
@s-lime: But you need a math's background to do that kind of problems. Street bit light was extremely hard, I didn't, and I haven't, understood what I have to do.
A
AhmedKamel
Actually, there is nothing annoying more than such bugs in z-trening contests, it always waste my time in the contest.

But the contest was good, and easy somehow, but on the other hand i see that two hours isn't enough :)
c
carlosjoa
@gates: did you mean even number of "proper" divisors (ie, excluding the number itself)?
o
ortschun
@s-lime : -( p*log2(p) + (1-p)*log2(1-p) )
why is that wrong for lamp?
g
gates
@carlosjoa:

No, all divisors.

that's because
( t1 + 1 ) * ( t2 + 1 ) * ... * ( tn + 1 )
is number of divisors.

every of n primes can have exponent in range [0, t1].

D
Daniel93
when will be the tasks availlable for solving?
c
carlosjoa
@gates:

12 is NOT a perfect square
There are 6 divisors of 12 are: 1, 2, 3, 4, 6, and 12.
Number of divisors, 6, is even.

25 is a perfect square.
There are 3 divisors of 25: 1, 5, 25
3 is odd.
g
gates
Ooops, my mistake. It is ok now. Thanks.
s
s-lime
AhmedKamel: I don't like bugs either, as I have spent really a lot of time preparing the tasks.
g
gates
btw. I saw task like Wooden Doors on one mathematic competition.
t
tgudlek
@s-lime: Why did you submit solutions on your own competition and stole someone's medal?
e
eduardische
@tgudlek: For example, to check the testing system. Now, that we know he has 40p on 1 task, we can tell that something is wrong with it)
t
tgudlek
@eduardische: you can test your own problems under the "My Tasks" section
e
eduardische
@tgudlek
s-lime on 5.4.2009 @ 21:32
Yes, that means it. I don't know what happened, when I was testing this task, everything worked OK.

So he did, and it seems that the bug is not everywhere. And he didn't stole someone's medal, he gived the bunch of them instead, because it is his contest)
s
s-lime
1. I did it for testing. So apparently, Not everything went OK with the tests.
@tgudlek: So, when I tested my tasks under "My tasks", i got 100/100. There I got only 40/100. So just don't be too smart.
2. I thought I would be mentioned at the bottom of the table, just like admin and moderator are. Because it is logical that the competition author cannot compete. I ask admin to remove me from the list or put me to the back.
P
Peteris

scanf("%d", &N);
for (i = 0; i < N; ++i)
{
scanf("%d %d", &b, &p);
if (b)
P *= p / 100.;
else
P *= (1 - p / 100.);
}
printf("%.5f\n" , -(log(P) / log(2)));

Where's the error? (bits)
R
RobertGerbicz
RE Peteris:
suppose that there are 15 consecutive 1 1 in the input. What do you think in the end about the value of P ?
s
s-lime
So, appearantly the task results are ok... Because the best programmers got all them AC or TLE, no WA...
Thanks to everyone for participation... The only bugous task was periodic system. The heck was in last newline and the grader...
t
tgudlek
Well, you should have submitted somebody elses codes to verify your own solutions.

Only admin and moderators are at the bottom of the page.
s
s-lime
@tgudlek: If I sent somebody else's code (where the hell am I going to get them), then I would also get 100/100.
The heck was in "\n", which grader cut out of the end of the file.
S
Sedols
Please Remove z-slime from the top of the result table, cuz he is author of this event, so he should be down with other admins.
t
tgudlek
Well, somebody else should have solved tasks before the competition.
o
ortschun
Just make the tasks public..
s
s-lime
@ortschun: Hope that will happen soon. But this is really something admin must do, I cannot.