結果
問題 | No.55 正方形を描くだけの簡単なお仕事です。 |
ユーザー |
|
提出日時 | 2018-05-21 19:40:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 661 bytes |
コンパイル時間 | 721 ms |
コンパイル使用メモリ | 66,944 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 15:32:18 |
合計ジャッジ時間 | 1,653 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
#include<iostream>#include<algorithm>using namespace std;int main(){double x[3], y[3];for(int i = 0; i < 3; i++) cin >> x[i] >> y[i];int order[3] = {0,1,2};bool frag = false;double vecx;double vecy;do{vecx = x[order[2]]-x[order[1]];vecy = y[order[2]]-y[order[1]];if(x[order[1]]-(vecy) == x[order[0]] && (y[order[1]]+vecx) == y[order[0]]){frag = true;break;}}while(next_permutation(order, order+3));if(frag){cout << (x[order[0]] + vecx) << " " << (y[order[0]] + vecy) << endl;}else{cout << -1 << endl;}return 0;}