Submission #51722059


Source Code Expand

K,X1,Y1,X2,Y2 = $<.read.split.map(&:to_i)
K2,DX,DY = K+K,(X2-X1).abs,(Y2-Y1).abs
p (DX+DY+K2-1)/K2+((DY-DX).abs+K2-1)/K2

Submission Info

Submission Time
Task D - Bishop
User ds14050
Language Ruby (ruby 3.2.2)
Score 200
Code Size 124 Byte
Status AC
Exec Time 127 ms
Memory 17332 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 26
Set Name Test Cases
Sample example0.txt, example1.txt
All example0.txt, example1.txt, maximum0.txt, maximum1.txt, maximum2.txt, maximum3.txt, random0.txt, random1.txt, random2.txt, random3.txt, random4.txt, random5.txt, random6.txt, random7.txt, random8.txt, random9.txt, random_k_small0.txt, random_k_small1.txt, random_k_small2.txt, random_k_small3.txt, random_k_small4.txt, random_k_small5.txt, random_k_small6.txt, random_k_small7.txt, random_k_small8.txt, random_k_small9.txt
Case Name Status Exec Time Memory
example0.txt AC 127 ms 17088 KiB
example1.txt AC 43 ms 17192 KiB
maximum0.txt AC 44 ms 17144 KiB
maximum1.txt AC 44 ms 17184 KiB
maximum2.txt AC 43 ms 17232 KiB
maximum3.txt AC 43 ms 17140 KiB
random0.txt AC 44 ms 17160 KiB
random1.txt AC 43 ms 17096 KiB
random2.txt AC 44 ms 17176 KiB
random3.txt AC 44 ms 17160 KiB
random4.txt AC 44 ms 17080 KiB
random5.txt AC 44 ms 17212 KiB
random6.txt AC 44 ms 17052 KiB
random7.txt AC 43 ms 17264 KiB
random8.txt AC 43 ms 16752 KiB
random9.txt AC 43 ms 16880 KiB
random_k_small0.txt AC 43 ms 17332 KiB
random_k_small1.txt AC 43 ms 16852 KiB
random_k_small2.txt AC 43 ms 17304 KiB
random_k_small3.txt AC 43 ms 17260 KiB
random_k_small4.txt AC 43 ms 17148 KiB
random_k_small5.txt AC 44 ms 17100 KiB
random_k_small6.txt AC 43 ms 17164 KiB
random_k_small7.txt AC 44 ms 17076 KiB
random_k_small8.txt AC 43 ms 17232 KiB
random_k_small9.txt AC 43 ms 17216 KiB