QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#697652#6412. Classical Geometry Problemtassei903#WA 15ms10696kbPython31.3kb2024-11-01 15:15:082024-11-01 15:15:08

Judging History

你现在查看的是最新测评结果

  • [2024-11-01 15:15:08]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10696kb
  • [2024-11-01 15:15:08]
  • 提交

answer


def norm(a, b, c):
    return (a**2+b**2+c**2)**0.5



def solve(a, b, c):#a,b,c <= 1/2
    ans = []

    if a + b + c >= 1:
        d = min(a, b, c)
        dd = d / (1-d)
        ans.append((1, 1, 1, dd * norm(1-a,1-b,1-c)))
        a,b,c = a - (1-a) * dd,b - (1-b) * dd,c - (1-c) * dd    
    
    dd = a / (1 - a)
    ans.append((1, 0, 0, dd * norm(1-a, b, c)))
    a, b, c = a - (1 - a) * dd, b - b * dd, c - c * dd

    dd = b / (1 - b)
    ans.append((0, 1, 0, dd * norm(a, 1-b, c)))
    a, b, c = a - a * dd, b - (1 - b) * dd, c - c * dd
    
    dd = c / (1 - c)
    ans.append((0, 0, 1, dd * norm(a, b, 1-c)))
    a, b, c = a - a * dd, b - b * dd, c - (1 - c) * dd
    
    assert max(abs(a), abs(b), abs(c)) <= 10 ** -8
    return ans[::-1]

m = 255

for _ in range(int(input())):
    a,b,c = map(int, input().split())
    flag = [0,0,0]
    ans = []
    if m - a < a:
        flag[0] = 1
        a = m - a
        ans.append((*flag, 1))
    if m - b < b:
        flag[1] = 1
        b = m - b
        ans.append((*flag, 1))
    if m - c < c:
        flag[2] = 1
        c = m - c
        ans.append((*flag, 1))
    ans += solve(a/m, b/m, c/m)
    print(len(ans))
    for r,g,b, t in ans:
        print((flag[0]^r) * m, (flag[1]^g) * m, (flag[2]^b) * m, t * m)

詳細信息

Test #1:

score: 0
Wrong Answer
time: 15ms
memory: 10696kb

input:

3
105 255 175
174 174 174
0 0 0

output:

5
0 0 255 255
0 0 0 255
0 255 0 24.000000000000007
0 0 255 0.0
255 255 255 119.0
6
0 255 255 255
0 0 255 255
0 0 0 255
255 255 0 34.43985947412319
255 0 255 44.189056734094095
0 255 255 96.97742054274721
3
0 0 255 0.0
0 255 0 0.0
255 0 0 0.0

result:

wrong answer too far from the target: (70.855644, 88.186878, 70.855644) instead of (105, 255, 175) (test case 1)