結果
問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
ユーザー |
|
提出日時 | 2017-06-17 14:02:55 |
言語 | Ruby (3.4.1) |
結果 |
AC
|
実行時間 | 89 ms / 5,000 ms |
コード長 | 297 bytes |
コンパイル時間 | 237 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-10-01 09:32:39 |
合計ジャッジ時間 | 3,184 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
コンパイルメッセージ
Main.rb:18: warning: ambiguous first argument; put parentheses or a space even after `-' operator Syntax OK
ソースコード
A, B, C = gets.split.take(6).map(&:to_i).each_slice(2).to_a def f() [A, B, C].permutation(3).find{|a, b, c| x = a[0] - b[0] y = b[1] - a[1] if c[0] - b[0] == y && c[1] - b[1] == x return [c[0] + x, c[1] - y] end } end ans = f() if ans puts ans * " " else p -1 end