結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー tanimani364
提出日時 2019-12-10 17:17:49
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 1,705 bytes
コンパイル時間 1,458 ms
コンパイル使用メモリ 128,696 KB
最終ジャッジ日時 2025-01-08 10:23:31
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

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

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
using namespace std;
void solve(){
pair<int,int>p[3];
rep(i,3)cin>>p[i].first>>p[i].second;
rep(i,3){
rep(j,3){
rep(k,3){
if(i==j||j==k||i==k)continue;
int calc=(p[i].first-p[k].first)*(p[j].first-p[k].first)+(p[i].second-p[k].second)*(p[j].second-p[k].second);
if(calc)continue;
if(sqrt((p[i].first-p[k].first)*(p[i].first-p[k].first)+(p[i].second-p[k].second)*(p[i].second-p[k].second))==sqrt((p[j].first-p[k].first
              )*(p[j].first-p[k].first)+(p[j].second-p[k].second)*(p[j].second-p[k].second))){
cout<<p[i].first+(p[j].first-p[k].first)<<" "<<p[i].second+(p[j].second-p[k].second)<<"\n";
return;
}
else {
cout<<-1<<"\n";
return;
}
}
}
}
cout<<-1<<"\n";
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout<<fixed<<setprecision(15);
solve();
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0