結果
| 問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
| コンテスト | |
| ユーザー |
memmemmi
|
| 提出日時 | 2018-06-27 14:27:43 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 952 bytes |
| コンパイル時間 | 730 ms |
| コンパイル使用メモリ | 92,884 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-30 23:09:57 |
| 合計ジャッジ時間 | 1,578 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
#define INF 1e9
#define PI acos(-1)
typedef long long ll;
int main() {
vector<int> index(3);
index[0] = 0; index[1] = 1; index[2] = 2;
vector<int> x(3), y(3);
for (int i = 0; i < 3; i++)cin >> x[i] >> y[i];
do {
int dy = y[index[1]] - y[index[0]];
int dx = x[index[1]] - x[index[0]];
if (y[index[2]] == y[index[1]] + dx && x[index[2]] == x[index[1]] - dy) {
int yans = y[index[2]] - dy;
int xans = x[index[2]] - dx;
cout << xans << " " << yans << endl;
return 0;
}
} while (next_permutation(index.begin(), index.end()));
cout << -1 << endl;
return 0;
}
memmemmi