結果
| 問題 | No.3664 Manhattan Circumcenter |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-30 15:42:33 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,019 bytes |
| 記録 | |
| コンパイル時間 | 1,178 ms |
| コンパイル使用メモリ | 214,548 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-08-30 15:42:42 |
| 合計ジャッジ時間 | 6,937 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 52 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
pair<int,int> P,Q,R;
cin >> P.first >> P.second,P.first *= 2,P.second *= 2;
cin >> Q.first >> Q.second,Q.first *= 2,Q.second *= 2;
cin >> R.first >> R.second,R.first *= 2,R.second *= 2;
auto dist = [&](int x1,int y1,int x2,int y2) -> int {return abs(x1-x2)+abs(y1-y2);};
vector<pair<int,int>> answer;
for(int i=-4000; i<=4000; i++) for(int k=-4000; k<=4000; k++){
auto [x1,y1] = P;
auto [x2,y2] = Q;
auto [x3,y3] = R;
int d1 = dist(x1,y1,i,k);
int d2 = dist(x2,y2,i,k);
int d3 = dist(x3,y3,i,k);
if(d1 == d2 && d2 == d3){
if(max(abs(i),abs(k)) > 2000){cout << "-1\n"; return 0;}
answer.push_back({i,k});
}
}
cout << answer.size() << "\n";
cout << fixed << setprecision(20);
for(auto [x,y] : answer){
cout << x/2.0 << " " << y/2.0 << "\n";
}
}