結果

問題 No.675 ドットちゃんたち
ユーザー cielciel
提出日時 2018-04-18 20:52:24
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,882 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 11,148 KB
実行使用メモリ 65,044 KB
最終ジャッジ日時 2023-09-09 11:27:06
合計ジャッジ時間 14,791 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
15,640 KB
testcase_01 AC 90 ms
15,788 KB
testcase_02 AC 91 ms
15,868 KB
testcase_03 AC 91 ms
15,692 KB
testcase_04 AC 91 ms
15,688 KB
testcase_05 AC 1,799 ms
65,044 KB
testcase_06 AC 1,882 ms
52,932 KB
testcase_07 AC 1,736 ms
57,160 KB
testcase_08 AC 1,843 ms
52,288 KB
testcase_09 AC 1,872 ms
52,832 KB
testcase_10 AC 1,879 ms
52,208 KB
testcase_11 AC 1,875 ms
54,732 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'matrix'
n,x,y=gets.split.map &:to_i
a=n.times.map{
	c=gets.split.map &:to_i
	c[0]==1?Matrix[[1,0,c[1]],[0,1,0],[0,0,1]]:
	c[0]==2?Matrix[[1,0,0],[0,1,c[1]],[0,0,1]]:
	Matrix[[0,1,0],[-1,0,0],[0,0,1]]
}
(n-2).downto(0){|i|a[i]=a[i+1]*a[i]}
s=''.dup
n.times{|i|s<<(a[i]*Vector[x,y,1])[0..1]*' '+"\n"}
puts s
0