10627 - Infinite Race

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

Moderator: Board moderators

10627 - Infinite Race

Postby cyfra » Fri Feb 27, 2004 10:46 am

Hi!

I tried to code this task on the contest but got WA.
Later I rewrote this task (this time without using any floats etc) and still got WA..

Does anyone have any tricky inputs for this task ??

Thanks in advance
Good Luck :wink:
cyfra
Experienced poster
 
Posts: 144
Joined: Thu Nov 22, 2001 2:00 am
Location: Gdynia, Poland

Postby Adrian Kuegel » Fri Feb 27, 2004 11:10 am

You may have some overflow problems. Try this input:
1 2147483647 2147483647 2147483647
Adrian Kuegel
Guru
 
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Postby cyfra » Fri Feb 27, 2004 11:35 am

Hi!
Thanks for answering ...

Adrian Kuegel wrote: Try this input:
1 2147483647 2147483647 2147483647


Unfortunately I use long long's for this and I don't think this may cause overflow problems..
My answer for this test is :

4611686014132420609

(Or is it wrong answer ??? )
cyfra
Experienced poster
 
Posts: 144
Joined: Thu Nov 22, 2001 2:00 am
Location: Gdynia, Poland

Postby Adrian Kuegel » Fri Feb 27, 2004 12:12 pm

Ok, then here are a few other test cases:
10 10 1 10
10 10 1 11
10 10 1 30
10 10 1 31
5 4 2 3
5 4 2 4
5 4 2 5
5 4 2 6
5 4 2 7
0 0 0 0
Output:
10
10
29
29
2
2
3
4
4
Adrian Kuegel
Guru
 
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany

Postby cyfra » Fri Feb 27, 2004 3:21 pm

I found my mistake .....

just a small one ;-) I had some problems, when they could met in the last minute ....

Thanks a lot for help

Best Regads
cyfra
Experienced poster
 
Posts: 144
Joined: Thu Nov 22, 2001 2:00 am
Location: Gdynia, Poland

more test cases

Postby ranjit » Tue May 11, 2004 3:06 pm

can somebody give me more test cases .

thanx in advance.

ranjit.
ranjit
New poster
 
Posts: 34
Joined: Fri Jan 30, 2004 11:22 am
Location: india

Re: more test cases

Postby windows2k » Thu Jun 24, 2004 3:45 pm

ranjit wrote:can somebody give me more test cases .

thanx in advance.

ranjit.

Could someone offer some idea to solve the problem?
Thx :D
windows2k
Experienced poster
 
Posts: 136
Joined: Sat Apr 05, 2003 3:29 pm
Location: Taiwan

Postby Observer » Thu Jun 24, 2004 5:00 pm

Simple math will do. Hint: you may start with working on the "faster" guy. Try to find out the relationship between the number of loops he travels and the number of times they meet. (That's my approach :wink:)
7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Observer
Guru
 
Posts: 570
Joined: Sat May 10, 2003 4:20 am
Location: Hong Kong

Postby SRX » Tue Nov 28, 2006 5:25 pm

Can someone give me the correct output of the input in the following ?
thanks!

Code: Select all
50 32 35 20
100 22 13 31
24 12 41 15
467 35 231 122
36 12 24 24
0 1 2 3 
studying @ ntu csie
SRX
Learning poster
 
Posts: 63
Joined: Sat May 14, 2005 8:13 am
Location: Taiwan

Re: 10627 - Infinite Race

Postby DJWS » Thu Oct 30, 2008 6:52 am

Code: Select all
14
6
26
61
12
DJWS
Learning poster
 
Posts: 100
Joined: Sat Oct 11, 2003 3:30 pm
Location: Taiwan

Re: 10627 - Infinite Race

Postby Blocat » Sat Jul 24, 2010 10:44 am

From http://uvatoolkit.com/problemssolve.php, I know this problem could be solved by gcd or other math methods. However, I didn't know how to use them for this problem. Could someone please give me more hints? Thanks. :D
Blocat
New poster
 
Posts: 2
Joined: Sat Jul 24, 2010 5:25 am


Return to Volume CVI

Who is online

Users browsing this forum: No registered users and 1 guest