QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#837059#1441. Special Gamemjkim112358RE 9ms10640kbPython3496b2024-12-29 14:44:192024-12-29 14:44:19

Judging History

This is the latest submission verdict.

  • [2024-12-29 14:44:19]
  • Judged
  • Verdict: RE
  • Time: 9ms
  • Memory: 10640kb
  • [2024-12-29 14:44:19]
  • Submitted

answer

n=int(input())
a=sorted(map(int,input().split()))
b=sorted(map(int,input().split()))
x=n
ans=0
t=1
while a:
    if(a[-1]<b[0]):
        if(t==0):ans+=len(a)
        break
    if(b[-1]<a[0]):
        if(t==1):ans+=len(a)
        break
    z=[-10**20,10**20];j=0
    for i in range(x):
        while j<x and a[i]>=b[j]:j+=1
        if(j==n):break
        if(z[0]-z[1]<i-j):z=[i,j]
    a.pop(z[0])
    b.pop(z[1])
    a,b=b,a
    if(t==0):ans+=1
    t=1-t
    x-=1
print(ans)

详细

Test #1:

score: 100
Accepted
time: 8ms
memory: 10524kb

input:

3
1 2 5
3 4 6

output:

1

result:

ok "1"

Test #2:

score: 0
Accepted
time: 8ms
memory: 10552kb

input:

2
4 3
1 2

output:

2

result:

ok "2"

Test #3:

score: 0
Accepted
time: 8ms
memory: 10640kb

input:

1
1
2

output:

0

result:

ok "0"

Test #4:

score: 0
Accepted
time: 9ms
memory: 10640kb

input:

9
2 12 10 3 4 7 17 14 16
6 1 13 11 9 15 18 8 5

output:

5

result:

ok "5"

Test #5:

score: -100
Dangerous Syscalls

input:

9
1 3 2 14 15 13 8 6 7
12 11 4 17 9 5 18 10 16

output:


result: