結果
問題 | No.675 ドットちゃんたち |
ユーザー |
![]() |
提出日時 | 2021-01-24 10:38:13 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 468 ms / 2,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 508 ms |
コンパイル使用メモリ | 8,320 KB |
実行使用メモリ | 38,056 KB |
最終ジャッジ日時 | 2025-01-02 14:08:44 |
合計ジャッジ時間 | 6,479 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 8 |
コンパイルメッセージ
Syntax OK
ソースコード
n, px, py = gets.split.map(&:to_i)x1, x2, y1, y2, s = 1, 0, 1, 0, falseputs (1..n).map { gets.split.map(&:to_i) }.reverse.map { |a|case a[0]when 1x2 -= a[1]when 2y2 -= a[1]when 3x1, x2, y1, y2, s = -y1, -y2, x1, x2, !sendx, y = (px - x2) * x1, (py - y2) * y1x, y = y, x if s[x, y]}.reverse.map { _1.join(' ') }.join("\n")