結果

問題 No.3664 Manhattan Circumcenter
コンテスト
ユーザー t98slider
提出日時 2026-08-30 16:14:14
言語 C++23
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 785 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,069 ms
コンパイル使用メモリ 335,012 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-08-30 16:14:24
合計ジャッジ時間 8,922 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 56
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<pair<int,int>> a(3), ans;
    for(auto &&[y, x] : a) cin >> y >> x;
    auto f = [&](int y, int x, int p){
        auto [y2, x2] = a[p];
        return abs(y - y2) + abs(x - x2);
    };
    for(int y = -50000; y <= 50000; y++){
        for(int x = -50000; x <= 50000; x++){
            if(f(y, x, 0) == f(y, x, 1) && f(y, x, 1) == f(y, x, 2)){
                ans.emplace_back(y, x);
                if(abs(y) > 40000 || abs(x) > 40000){
                    cout << "-1\n";
                    return 0;
                }
            }
        }
    }
    cout << ans.size() << '\n';
    for(auto [y, x] : ans) cout << y << " " << x << "\n";
}
0