Page 1 of 1
10091 - The Valentine's Day
Posted: Fri Sep 27, 2002 1:25 am
by ithamar
Hi everybody.
I try to solve this problem and i just get WA's. I think that this is a easy problem. I simulate month by month to get all the probabilities of every node at the end (This is done with each person). Later i get the probability that Bill and Marsha encounter in any node.
Is my approach wrong. There is something extrange with the data. Help would be appreciated.
Thanxs in advance
Posted: Fri Sep 27, 2002 10:59 am
by Yarin
I hope you've taken into account that there's no Valentines day before the year 470...
10091
Posted: Wed Jul 02, 2003 8:13 am
by windows2k
I am bad at math

Could someone give me some hints?
10091 WA
Posted: Thu Jan 27, 2005 10:56 pm
by ranjit
I have got WA many times in this problem. I think there are many ambiguties.
For eg. the problem says the persons are transferred every new month. Does that mean
they shift over on the 1st of the new month or exactly one month later. Ofcourse the latter
assumption is instantly proved inconsistent since transfers are not possible from 31st
Jan to 31st Feb for eg.
I would like to know whether there will be exactly R lines of the graph description without any
invalid characters in between since nothing is mentioned very clearly. What does the
problem setter mean when he asks us to ignore the input.Does it mean we have to look for
R inputs or R lines.
Finally can anybody give me some more test cases and clarify the doubts.
I know some of the above doubts are trivial. But WA
Please help.
Thanx
Problem with computeing the number of iterations
Posted: Mon Sep 26, 2005 4:42 pm
by Moha
I got WA in this problem, can anybody help me?
I think i did a mistake in computeing the number of iterations(number of months to iterate)
this is my iteration computing code:
Code: Select all
if(y<470)
yy=12*(469-y)+13-m,y=469,m=1;
if(m>2||m==2&&d>=14)
yy+=14-m;
else yy+=2-m;
it that correct?
WA?
Posted: Mon Sep 26, 2005 5:17 pm
by Moha
This is my code, but i got WA in it. can anybody test my code?
Code: Select all
Code have been removed, I got Accepted!
with especial thanks to mjf :D
Posted: Mon Feb 19, 2007 3:13 am
by tgoulart
Can someone tell me if this code to find the number of changes is right?
Code: Select all
// months[12] = {1,0,11,10,9,8,7,6,5,4,3,2};
changes = months[m-1];
if (m == 1 || (m == 2 && d < 14)) {
if (y < 470)
changes += (470-y)*12;
}
else {
if (m == 2)
changes = 12;
if (y < 469)
changes += (469-y)*12;
if (d >= 14)
changes--;
}
I know it's poor, but this is my 82342456726815th try. I hate guessing...
Posted: Wed Jun 20, 2007 7:21 am
by tgoulart
Just to make it clear, the above test is wrong. A new month means every 1st day.
Re: 10091 - The Valentine's Day
Posted: Sat Mar 14, 2009 5:56 pm
by crip121
can anybody check whether my iterate calculation is right or wrong
Code: Select all
long iteration_time(long y,long m,long d) // year, month, day
{
long x;
if(y<470)
{
x = (470-y-1)*12+(12-m+2);
}
else if(m<2 || (m==2&&d<14) )
{
x = 2-m;
}
else
{
x = (12-m+2);
}
return x;
}
Re: 10091 - The Valentine's Day
Posted: Tue Mar 17, 2009 5:18 pm
by crip121
what is the output for following input
Code: Select all
1
460 2 1
20
A B
B C
C D
D E
E F
F G
G H
H I
I J
J K
K L
L M
M N
N O
O P
P Q
Q R
R S
S T
T U
A U
i WA code gives
Re: 10091 - The Valentine's Day
Posted: Tue Mar 17, 2009 7:01 pm
by tgoulart
crip121 wrote:what is the output for following input
Code: Select all
1
460 2 1
20
A B
B C
C D
D E
E F
F G
G H
H I
I J
J K
K L
L M
M N
N O
O P
P Q
Q R
R S
S T
T U
A U
i WA code gives
My AC code gives 0.03127.
Re: 10091 - The Valentine's Day
Posted: Fri Apr 17, 2009 1:49 pm
by marzot
Hey tgoulart.
With the following input.
Your AC code gives 0.03127.
Mine also gives 0.03419.
But when I subtracted the number of months has passed by 12, I got 0.03127 as you. It doesn't make sense to me. Cause this could mean 469 it's the first year of the valentine's day celebration.
what's the output of these two cases?
{
2
469 1 1
2
A B
B C
A C
469 3 1
2
A B
B C
A C
}
-----------------------------------------
1
460 2 1
20
A B
B C
C D
D E
E F
F G
G H
H I
I J
J K
K L
L M
M N
N O
O P
P Q
Q R
R S
S T
T U
A U
Re: 10091 - The Valentine's Day
Posted: Fri Apr 17, 2009 5:33 pm
by tgoulart
I got the following output:
I was talking to crip121 and maybe my calculated number of iterations is wrong. I had a bad time trying to get AC on this, and i tried many ways to find the number of months.