結果
問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
ユーザー |
![]() |
提出日時 | 2018-12-28 13:08:09 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 658 bytes |
コンパイル時間 | 429 ms |
コンパイル使用メモリ | 59,840 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-01 14:58:57 |
合計ジャッジ時間 | 1,243 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
#include <iostream> #include <algorithm> #include <cstdio> #include <string> #include <vector> #include <numeric> #define ll long long using namespace std; int main(){ int x1,y1,x2,y2,x3,y3; cin>>x1>>y1>>x2>>y2>>x3>>y3; int l1,l2,l3; l3=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2); l2=(x1-x3)*(x1-x3)+(y1-y3)*(y1-y3); l1=(x3-x2)*(x3-x2)+(y3-y2)*(y3-y2); if(l1==l2&&l1*2==l3){ cout<<x2+x1-x3<<" "<<y2+y1-y3<<endl; }else if(l1==l3&&l1*2==l2){ cout<<x1+x3-x2<<" "<<y1+y3-y2<<endl; }else if(l2==l3&&l2*2==l1){ cout<<x2+x3-x1<<" "<<y2+y3-y1<<endl; }else{ cout<<-1<<endl; } return 0; }