結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー Ryogo1008
提出日時 2014-11-04 23:36:46
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 677 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 59,736 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-30 17:27:10
合計ジャッジ時間 1,711 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 11 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<math.h>
using namespace std;

typedef pair<int,int> P;



int main(){
	P data[3];
	
	for(int i=0;i<3;i++)cin>>data[i].first>>data[i].second;	
	
	for(int i=0;i<3;i++){
		int tmp=0;
		for(int j=0;j<3;j++){
			if(i!=j){
				if(tmp==0)tmp=pow(data[i].first-data[j].first,2.0)+pow(data[i].second-data[j].second,2.0);
				else {
					if(tmp==pow(data[i].first-data[j].first,2.0)+pow(data[i].second-data[j].second,2.0)){
						int x=0,y=0;
						for(int k=0;k<3;k++){
							x+=data[k].first;
							y+=data[k].second;
						}
						cout<<x<<" "<<y<<endl;
						goto suc;
					}
				}
			}
		}
	}
	cout<<-1<<endl;
	suc:;
}
0