結果
問題 |
No.675 ドットちゃんたち
|
ユーザー |
![]() |
提出日時 | 2021-01-24 10:04:45 |
言語 | Crystal (1.14.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 562 bytes |
コンパイル時間 | 11,498 ms |
コンパイル使用メモリ | 295,352 KB |
実行使用メモリ | 28,472 KB |
最終ジャッジ日時 | 2024-06-30 22:09:01 |
合計ジャッジ時間 | 13,708 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 3 WA * 5 |
ソースコード
lib C fun strtoll(s : UInt8*, p : UInt8**, b : Int32) : Int64 end class String def to_i64 C.strtoll(self, nil, 10) end end n, px, py = read_line.split.map(&.to_i) com = (1..n).map { read_line.split.map(&.to_i) } x1, x2, y1, y2, s = 1, 0, 1, 0, false ans = com.reverse.map do |a| case a[0] when 1 x2 -= a[1] when 2 y2 -= a[1] when 3 y1 *= -1 x1, y1 = y1, x1 x2, y2 = y2, x2 s = !s end x, y = px, py x = (x - x2) // x1 y = (y - y2) // y1 x, y = y, x if s {x, y} end puts ans.reverse.join('\n', &.join(' '))