結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー Ryogo1008Ryogo1008
提出日時 2014-11-04 23:36:46
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 677 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 59,332 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-29 00:33:12
合計ジャッジ時間 1,484 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1 ms
4,380 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1 ms
4,376 KB
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

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