QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#369134#8247. ICPC Team Generationmfshi03WA 9ms9432kbPython3606b2024-03-27 20:55:032024-03-27 20:55:13

Judging History

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

  • [2024-03-27 20:55:13]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:9432kb
  • [2024-03-27 20:55:03]
  • 提交

answer

def max_teams(n, a, b):
    teams = 0
    last_used = 0

    for i in range(1, n + 1):
        if i > last_used:
            if i + 1 <= n and i + 1 <= b[i] and i + 2 <= n and i + 2 <= b[i]:
                teams += 1
                last_used = i + 2
            elif i + 1 <= n and i + 1 <= b[i] and a[i + 1] <= i:
                teams += 1
                last_used = i + 1

    return teams

# Read input
n = int(input())
a = [0] * (n + 1)
b = [0] * (n + 1)
for i in range(1, n + 1):
    a[i], b[i] = map(int, input().split())

# Solve and print output
print(max_teams(n, a, b))

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 9ms
memory: 9432kb

input:

6
1 2
1 2
2 5
2 6
2 6
5 6

output:

2

result:

wrong answer 1st lines differ - expected: '1', found: '2'