Submission #19947952


Source Code Expand

Copy
N = gets.to_i
P = [
[0,0],
*N.times.map{
gets.split.map(&:to_i)
}
]
M = gets.to_i
B = [
(a,b, c,d, e,f = 0,0, 1,0, 0,1),
*$<.take(M).map{|ln|
p2 = 2*ln[2,11].to_i
a,b, c,d ,e,f = case ln[0]
when ?1; [b,-a, d,-c, f,-e]
when ?2; [-b,a, -d,c, -f,e]
when ?3; [p2-a,b, p2-c,d, p2-e,f]
when ?4; [a,p2-b, c,p2-d, e,p2-f]
end
}
]
Q = gets.to_i
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
N = gets.to_i
P = [
	[0,0],
	*N.times.map{
		gets.split.map(&:to_i)
	}
]
M = gets.to_i
B = [
	(a,b, c,d, e,f = 0,0, 1,0, 0,1),
	*$<.take(M).map{|ln|
		p2 = 2*ln[2,11].to_i
		a,b, c,d ,e,f = case ln[0]
			when ?1; [b,-a, d,-c, f,-e]
			when ?2; [-b,a, -d,c, -f,e]
			when ?3; [p2-a,b, p2-c,d, p2-e,f]
			when ?4; [a,p2-b, c,p2-d, e,p2-f]
			end
	}
]
Q = gets.to_i
Q.times{
	b,p = gets.split.map(&:to_i)
	a,b, c,d, e,f = B[b]
	x,y = P[p]
	puts "#{a+(c-a)*x+(e-a)*y} #{b+(d-b)*x+(f-b)*y}"
}

Submission Info

Submission Time
Task E - Rotate and Flip
User ds14050
Language Ruby (2.7.1)
Score 500
Code Size 515 Byte
Status AC
Exec Time 950 ms
Memory 69460 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 28
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All max_01.txt, max_02.txt, max_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
max_01.txt AC 872 ms 69460 KB
max_02.txt AC 840 ms 69000 KB
max_03.txt AC 240 ms 57652 KB
random_01.txt AC 60 ms 14192 KB
random_02.txt AC 62 ms 14132 KB
random_03.txt AC 64 ms 14272 KB
random_04.txt AC 62 ms 14320 KB
random_05.txt AC 59 ms 14112 KB
random_06.txt AC 64 ms 14092 KB
random_07.txt AC 63 ms 14192 KB
random_08.txt AC 61 ms 14236 KB
random_09.txt AC 64 ms 14120 KB
random_10.txt AC 63 ms 14168 KB
random_11.txt AC 58 ms 14156 KB
random_12.txt AC 63 ms 14260 KB
random_13.txt AC 64 ms 14120 KB
random_14.txt AC 62 ms 14132 KB
random_15.txt AC 62 ms 14220 KB
random_16.txt AC 60 ms 14116 KB
random_17.txt AC 58 ms 14080 KB
random_18.txt AC 62 ms 14128 KB
random_19.txt AC 61 ms 14156 KB
random_20.txt AC 65 ms 14216 KB
random_21.txt AC 487 ms 41772 KB
random_22.txt AC 943 ms 69404 KB
random_23.txt AC 950 ms 69056 KB
sample_01.txt AC 58 ms 14268 KB
sample_02.txt AC 61 ms 14116 KB


2025-04-05 (Sat)
21:29:50 +00:00