結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー gigurururugigurururu
提出日時 2014-11-03 00:40:38
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 256 bytes
コンパイル時間 57 ms
コンパイル使用メモリ 11,564 KB
実行使用メモリ 15,372 KB
最終ジャッジ日時 2023-08-29 00:24:57
合計ジャッジ時間 3,086 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,048 KB
testcase_01 AC 79 ms
15,132 KB
testcase_02 AC 81 ms
15,120 KB
testcase_03 AC 77 ms
15,040 KB
testcase_04 WA -
testcase_05 AC 77 ms
15,144 KB
testcase_06 AC 78 ms
15,184 KB
testcase_07 AC 78 ms
15,068 KB
testcase_08 AC 78 ms
15,140 KB
testcase_09 AC 77 ms
15,352 KB
testcase_10 AC 75 ms
15,084 KB
testcase_11 AC 76 ms
15,260 KB
testcase_12 WA -
testcase_13 AC 77 ms
15,176 KB
testcase_14 AC 78 ms
15,360 KB
testcase_15 AC 77 ms
15,164 KB
testcase_16 AC 79 ms
15,244 KB
testcase_17 WA -
testcase_18 AC 76 ms
15,140 KB
testcase_19 AC 76 ms
15,156 KB
testcase_20 AC 76 ms
15,172 KB
testcase_21 AC 77 ms
15,164 KB
testcase_22 AC 76 ms
15,052 KB
testcase_23 AC 79 ms
15,084 KB
testcase_24 AC 76 ms
15,260 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def x a,b;(a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1]);end
a=[*gets.split.map(&:to_i).each_slice(2)]
g=a.zip(a.rotate).map{|i,j|x i,j}
n=g.zip(g.rotate).index{|i,j|i==j}
puts n ?a.rotate(n-2).inject{|(i,j),(k,l)|[i+k-a[n-2][0],j+l-a[n-2][1]]}*" ":-1
0