QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#61816#692. Delete the PointscucudangWA 2ms8380kbPython3692b2022-11-15 00:52:442022-11-15 00:52:47

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-15 00:52:47]
  • Judged
  • Verdict: WA
  • Time: 2ms
  • Memory: 8380kb
  • [2022-11-15 00:52:44]
  • Submitted

answer

def f(p1,p2,p3):
  x1,x2 = sorted((p1[0], p2[0]))
  y1,y2 = sorted((p1[1], p2[1]))
  w = x2 - x1
  h = y2 - y1
  s = max(w,h)
  if h < w:
    y2 += 0.5
  elif w < h:
    x2 += 0.5
  x1 = x2 - s
  y1 = y2 - s
  if x1 <= p3[0] <= x2 and y1 <= p3[1] <= y2:
    return 0
  print(f"{x1:.1f} {y1:.1f} {x2:.1f} {y2:.1f}")
  return 1
n = int(input())
a = sorted([[*map(int, input().split())] for _ in range(n)])
# a.append([1<<31,0])

p1 = a[0]
for i in range(1,n-1,2):
  p2,p3 = a[i:i+2]
  d = 0
  for j in range(3):
    if f(p1,p2,p3):
      d = 1
      break
    p1,p2,p3 = p2,p3,p1
  if d == 0:
    s = 3 // 0
  p1 = p3
print("-1.0 -1.0 1123456789.0 1123456789.0")

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 8380kb

input:

4
1 1
2 2
5 5
6 6

output:

1.0 1.0 2.0 2.0
-1.0 -1.0 1123456789.0 1123456789.0

result:

wrong answer The participant does not have a solution