結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー samplelpmas
提出日時 2017-02-04 20:29:39
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 816 bytes
コンパイル時間 2,549 ms
コンパイル使用メモリ 76,468 KB
実行使用メモリ 42,344 KB
最終ジャッジ日時 2024-12-24 06:18:37
合計ジャッジ時間 7,030 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 14 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int x1 = sc.nextInt();
        int y1 = sc.nextInt();

        int x2 = sc.nextInt();
        int y2 = sc.nextInt();

        int x3 = sc.nextInt();
        int y3 = sc.nextInt();

        for (int i = 0; i < 3; i++) {

            if ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) == (x2 - x3) * (x2 - x3) + (y2 - y3) * (y2 - y3)) {

                if ((x1 - x2) * (x2 - x3) + (y1 - y2) * (y2 - y3) == 0) {

                    int x4 = x3 + x1 - x2;
                    int y4 = y3 + y1 - y2;

                    System.out.println(x4 + " " + y4);
                    return;

                }

            }

        }

        System.out.println(-1);

    }

}
0