ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1125. Hopscotch

Plz,are there any skills to solve it in TL?
Posted by SunMoonStar 3 Sep 2003 20:13
Re: Plz,are there any skills to solve it in TL?
Posted by TheBeet 27 May 2004 14:58
It is easy.
I just two array.
 for point(x,y)
 change these point:
  x+dx,y+dy
  x+dx,y-dy
  x-dx,y+dy
  x-dx,y-dy

Then you will got AC in 0.031s.
##########################################################
dx:array [0..52] of longint=(0,3,4,5,6,7,8,8,9,9,10,12,12,12,12,14,15,15,15,16,16,18,20,20,20,21,21,24,24,24,24,24,27,28,28,30,30,32,33,35,36,36,36,40,40,40,42,44,45,45,48,48,48);
dy:array [0..52] of longint=(0,4,3,12,8,24,6,15,12,40,24,5,9,16,35,48,8,20,36,12,30,24,15,21,48,20,28,7,10,18,32,45,36,21,45,16,40,24,44,12,15,27,48,9,30,42,40,33,24,28,14,20,36);
##########################################################

Edited by author 29.05.2004 08:52
Re: Plz,are there any skills to solve it in TL?
Posted by PSV 17 Nov 2006 22:44
Fuckie solution.. Just take check all points to can change it on every move. And it's not TLE !!! May be you make unnecessary changes (mod 2 just!!!)
Re: Plz,are there any skills to solve it in TL?
Posted by Mak✭kbtu 16 May 2010 20:40
When you are reading the data input, take it by modulo 2. My solution with long long got TLE, but after processing ints by modulo 2, everything was ok.