結果
| 問題 | No.3664 Manhattan Circumcenter |
| コンテスト | |
| ユーザー |
sepa38
|
| 提出日時 | 2026-08-30 14:28:44 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 586 bytes |
| 記録 | |
| コンパイル時間 | 248 ms |
| コンパイル使用メモリ | 95,852 KB |
| 実行使用メモリ | 84,096 KB |
| 最終ジャッジ日時 | 2026-08-30 14:28:52 |
| 合計ジャッジ時間 | 7,056 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 55 WA * 2 |
ソースコード
def manhattan_distance(p1, p2):
x1, y1 = p1
x2, y2 = p2
return abs(x1 - x2) + abs(y1 - y2)
def is_circumcenter(c, p, q, r):
d = manhattan_distance(c, p)
return d == manhattan_distance(c, q) == manhattan_distance(c, r)
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
r = tuple(map(int, input().split()))
ans = []
for x2 in range(-10, 210):
for y2 in range(-10, 210):
x = x2 / 2
y = y2 / 2
if is_circumcenter((x, y), p, q, r):
ans.append((x, y))
if len(ans) > 2:
print(-1)
else:
print(len(ans))
for v in ans:
print(*v)
sepa38