QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#61812#692. Delete the PointscucudangWA 29ms8456kbPython3567b2022-11-15 00:31:242022-11-15 00:31:25

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:31:25]
  • Judged
  • Verdict: WA
  • Time: 29ms
  • Memory: 8456kb
  • [2022-11-15 00:31:24]
  • Submitted

answer

def f(p1,p2,p3):
  y1,y2 = sorted((p1[0], p2[0]))
  x1,x2 = 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[1] <= x2 and y1 <= p3[0] <= y2:
    return 0
  print(x1,y1,x2,y2)
  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,2):
  p2,p3 = a[i:i+2]
  for j in range(3):
    if f(p1,p2,p3):
      break
    p1,p2,p3 = p2,p3,p1
  p1 = p3
  

详细

Test #1:

score: 0
Wrong Answer
time: 29ms
memory: 8456kb

input:

4
1 1
2 2
5 5
6 6

output:

1 1 2 2
5 5 6 6

result:

wrong answer The participant does not have a solution