Submission #19690206
Source Code Expand
Copy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
(N,Pts),(M,Ops),(Q,Qry) = 3.times.map{
[n = gets.to_i, $<.take(n).map{|ln| ln.split.map(&:to_i) }]
}
W = [nil]*(M+1)
Qry.each_with_index{|(a,b),q|
(W[a]||=[]) << [b-1,q]
}
Ans = [nil]*Q
(Ops+[1]).inject([[0,0],[1,0],[0,1]]){|oxy,(op,*axis)|
if w = W.shift
w.each{|b,q|
ax,ay = Pts[b]
x,y = oxy.transpose.map{|o,x,y| o+ax*(x-o)+ay*(y-o) }
Ans[q] = "#{x} #{y}"
}
end
next oxy.map(&[nil,lambda{ lambda{|(x,y)|
[y,-x]
}},lambda{ lambda{|(x,y)|
[-y,x]
}},lambda{|xp| lambda{|(x,y)|
[xp+xp-x,y]
}},lambda{|yp| lambda{|(x,y)|
[x,yp+yp-y]
}}][op][*axis])
}
puts Ans
Submission Info
Submission Time |
|
Task |
E - Rotate and Flip |
User |
ds14050 |
Language |
Ruby (2.7.1) |
Score |
500 |
Code Size |
619 Byte |
Status |
AC |
Exec Time |
1497 ms |
Memory |
103080 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
500 / 500 |
Status |
|
|
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 |
1316 ms |
101072 KB |
max_02.txt |
AC |
1261 ms |
99084 KB |
max_03.txt |
AC |
500 ms |
45524 KB |
random_01.txt |
AC |
62 ms |
14164 KB |
random_02.txt |
AC |
61 ms |
14224 KB |
random_03.txt |
AC |
64 ms |
14168 KB |
random_04.txt |
AC |
62 ms |
14164 KB |
random_05.txt |
AC |
60 ms |
14360 KB |
random_06.txt |
AC |
58 ms |
14184 KB |
random_07.txt |
AC |
62 ms |
14060 KB |
random_08.txt |
AC |
58 ms |
14100 KB |
random_09.txt |
AC |
59 ms |
14224 KB |
random_10.txt |
AC |
61 ms |
14204 KB |
random_11.txt |
AC |
57 ms |
14300 KB |
random_12.txt |
AC |
58 ms |
14268 KB |
random_13.txt |
AC |
59 ms |
14176 KB |
random_14.txt |
AC |
62 ms |
14380 KB |
random_15.txt |
AC |
62 ms |
14124 KB |
random_16.txt |
AC |
60 ms |
14236 KB |
random_17.txt |
AC |
62 ms |
14224 KB |
random_18.txt |
AC |
60 ms |
14288 KB |
random_19.txt |
AC |
67 ms |
14128 KB |
random_20.txt |
AC |
61 ms |
14260 KB |
random_21.txt |
AC |
740 ms |
56652 KB |
random_22.txt |
AC |
1481 ms |
103080 KB |
random_23.txt |
AC |
1497 ms |
102696 KB |
sample_01.txt |
AC |
60 ms |
14080 KB |
sample_02.txt |
AC |
61 ms |
14316 KB |