← Back to topics
Topic

Tribe

R
RobertGerbicz
The time limit is too tight: in c just reading the input by scanf:
test 8 Execution time: 0.09s
test 9 Time limit exceeded
test 10 Time limit exceeded
And the time limit is 0.1 sec., this is too small in c.

And I don't understand the problem. Currently my code gives 4 for the sample input. For the 10 tests: 6 AC, 2 WA, 2 TLE. From the problem statement:

"find out how many Msongwa Tuvians won't talk to him in the worst-case scenario."

"maximum possible number of Msongwa Tuevians which heard about Meštar's mistake"

It's a contradiction, that's two different number in general.
t
tgudlek
It's the same :) Every Msongwa Tuevian that heard about Meštar's handshake won't talk to him. Since we don't knw which one, in the worst-case scenario, we suppose it's someone from the biggest talking group.

I will raise TL :)


Edit: Task statement is changed.
R
RobertGerbicz
Thanks for the correction, now I've got AC.
t
tgudlek
No prob. What the heck are you doing? I don't understand your code, not even a bit! :D
R
RobertGerbicz
My solution is bfs, I'm using this code for bfs problems. I've developed it some years ago.
t
tgudlek
Oh. Very strange though, all those pointers, references and allocs :)
j
jokermc1
uhm can i get help?
i do also bfs but i got WA on 5,8,10??
i
iggy91
Interesting. You just checked the case when first guy has heard of handshake. It's not necessary that it's the first one... It could be any of N of them...

So, you have to start BFS (or DFS, whatever) for EVERY node, not only from the first one.

And it's veeery strange that you got AC in SEVEN (?!) test cases of 10 with this algorithm. To much. You got lucky... =P
j
jokermc1
i have a luck where I really dont need it :)
t
tgudlek
@iggy91: Randomly generated, blame my PC :))