I'm an ACer. I want to say some truth.
You may see from the details. My three programs are nearly
the same, but I got different time. Because I'm using CPP
and I'm using FStream.h.
First, n<=100 is exact!
Number of Clients <= 10000!
The time, you can use longint to record. I use "int" in cpp
as "longint" in pascal, and I've got ACed.
Don't be lost in this hint:
If 1000 days since the funeral passed and the tomb is not
dug over then the forgetful relatives wouldn't find the tomb
and wouldn't see its neighbors.
Good luck. Others are quite good.
And the problem is quite easy in fact.
Re: I'm an ACer. I want to say some truth.
Posted by
AOY++ 28 May 2003 07:48
I still have a question:
If the funeral was on day 1, and on day 999 the tomb was visited,
can the tomb be dug on day 1002?
No. So I said that you don't lose yourself in hint 6!! :)
I'm still not so clear...
Posted by
AOY++ 28 May 2003 18:31
If on time 1, the client was buried. And on time 1001, he was
visited. So if there was no more visit, this tomb cannot be dug over
before time 2002. And at the same time, after time 1001, someone
wanted to visit the tomb, he wouldn't find the place so the visit
would effect nothing.
Am I right?
Sorry, it's a misprint. Instead of "funeral" it should be "last visit"
Why is the sample output 3?
Posted by
AOY++ 29 May 2003 12:51
client #2 was visited 3 times, on 500, 1236, 2032. so the client
came on time 2033 had no place to bury.
and also the client came on time 300, 1001, 1003.
so the answer is 4.
which point did i sill misunderstand, please?
3 clients is correct answer
> client #2 was visited 3 times, on 500, 1236, 2032. so the client
> came on time 2033 had no place to bury.
No, at 2004 all tombs exept the one, where client 2 rests, are dug
over (empty). At 2032 relatives of clint 2 saw three empty
neighbouring tombs.
> and also the client came on time 300, 1001, 1003.
that is true, 3 clients altogether
In a hint 6 instead of "since the funeral" in should be
"since the last visit"
So Don't lose yourself in this hint! :-)
>
Not sure about the 1000-days hint
Hi there. I've got AC and would like to clarify some thing.
You say:
>Don't be lost in this hint:
>If 1000 days since the funeral passed and the tomb is not
>dug over then the forgetful relatives wouldn't find the tomb
>and wouldn't see its neighbors.
I think this is incorrect. In fact (I got AC before looking at the webboard for the first time) I had the following code when checking whether the visit will succeed:
if (time <= last_visit[visit_who] + 1000)
//visit may happen, need to check other conditions
else
//visit impossible, they don't remember where the tomb is
This must be what you mean, right? Well, I got WA on test 6 with this code, and got AC after removing this condition, so, the real condition to check if visit will succeed is whether anybody still affects - either the last visit of relatives, or the last visit of neighbours.