結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー EmKjp
提出日時 2015-03-06 08:19:09
言語 C++11
(gcc 13.3.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,210 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 83,964 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-08 03:39:09
合計ジャッジ時間 1,606 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<numeric>
#include<functional>
#include<complex>
using namespace std;
#define BET(a,b,c) ((a)<=(b)&&(b)<(c))
#define FOR(i,n) for(int i=0,i##_end=(int(n));i<i##_end;i++)
#define SZ(x) (int)(x.size())
#define ALL(x) (x).begin(),(x).end()
#define MP make_pair
#define FOR_EACH(it,v) for(__typeof(v.begin()) it=v.begin(),it_end=v.end() ; it != it_end ; it++)
typedef vector<int> VI;
typedef vector<VI> VVI;
int X[4],Y[4];
int sq(int x){ return x * x; }
int main()
{
FOR(i,3) cin>>X[i]>>Y[i];
FOR(i,3) {
int x0 = X[i];
int y0 = Y[i];
int x1 = X[(i+1)%3];
int y1 = Y[(i+1)%3];
int x2 = X[(i+2)%3];
int y2 = Y[(i+2)%3];
int dx1 = x1 - x0;
int dy1 = y1 - y0;
int dx2 = x2 - x0;
int dy2 = y2 - y0;
if(sq(dx1) + sq(dy1) != sq(dx2) + sq(dy2))continue;
if(dx1 * dy1 + dx2 * dy2 != 0) continue;
cout<<x0+dx1+dx2<<" "<<y0+dy1+dy2<<endl;
return 0;
}
cout<<-1<<endl;
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0