結果
| 問題 | No.55 正方形を描くだけの簡単なお仕事です。 |
| コンテスト | |
| ユーザー |
tanimani364
|
| 提出日時 | 2019-12-10 17:39:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 5,000 ms |
| コード長 | 1,258 bytes |
| 記録 | |
| コンパイル時間 | 1,180 ms |
| コンパイル使用メモリ | 129,988 KB |
| 最終ジャッジ日時 | 2025-01-08 10:24:24 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#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(){
vector<int>v(3);
iota(v.begin(),v.end(),0);
vector<int>x(3),y(3);
rep(i,3)cin>>x[i]>>y[i];
do{
int dx=x[v[1]]-x[v[0]];
int dy=y[v[1]]-y[v[0]];
if(x[v[1]]-dy==x[v[2]]&&y[v[1]]+dx==y[v[2]]){
cout<<x[v[2]]-dx<<" "<<y[v[2]]-dy<<"\n";
return;
}
}while(next_permutation(v.begin(),v.end()));
cout<<-1<<"\n";
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout<<fixed<<setprecision(15);
solve();
return 0;
}
tanimani364