結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,080 KB
testcase_01 AC 79 ms
15,368 KB
testcase_02 AC 77 ms
15,092 KB
testcase_03 AC 80 ms
15,056 KB
testcase_04 WA -
testcase_05 AC 81 ms
15,140 KB
testcase_06 AC 81 ms
15,256 KB
testcase_07 AC 79 ms
15,096 KB
testcase_08 AC 77 ms
15,152 KB
testcase_09 AC 78 ms
15,140 KB
testcase_10 AC 80 ms
15,136 KB
testcase_11 AC 76 ms
15,140 KB
testcase_12 WA -
testcase_13 AC 80 ms
15,264 KB
testcase_14 AC 80 ms
15,084 KB
testcase_15 AC 79 ms
15,320 KB
testcase_16 AC 81 ms
15,140 KB
testcase_17 WA -
testcase_18 AC 80 ms
15,112 KB
testcase_19 AC 80 ms
15,128 KB
testcase_20 AC 80 ms
15,308 KB
testcase_21 AC 79 ms
15,248 KB
testcase_22 AC 80 ms
15,324 KB
testcase_23 AC 80 ms
15,148 KB
testcase_24 AC 79 ms
15,332 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 a.uniq.size==3&&n ?a.rotate(n-2).inject{|(i,j),(k,l)|[i+k-a[n-2][0],j+l-a[n-2][1]]}*" ":-1
0