結果
問題 |
No.55 正方形を描くだけの簡単なお仕事です。
|
ユーザー |
![]() |
提出日時 | 2025-01-12 12:13:58 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 765 bytes |
コンパイル時間 | 3,720 ms |
コンパイル使用メモリ | 278,780 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2025-01-12 12:14:03 |
合計ジャッジ時間 | 4,979 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { vector<pair<int, int>> v(3); rep(i, 3) cin >> v[i].first >> v[i].second; vector<int> p(3); iota(p.begin(), p.end(), 0); do { int dx = v[p[1]].first - v[p[0]].first; int dy = v[p[1]].second - v[p[0]].second; Debug(p, dx, dy); if (v[p[2]].first - v[p[1]].first == -dy && v[p[2]].second - v[p[1]].second == dx) { cout << v[p[2]].first - dx << ' ' << v[p[2]].second - dy << endl; return 0; } } while (next_permutation(p.begin(), p.end())); cout << -1 << endl; return 0; }