QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#369134 | #8247. ICPC Team Generation | mfshi03 | WA | 9ms | 9432kb | Python3 | 606b | 2024-03-27 20:55:03 | 2024-03-27 20:55:13 |
Judging History
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))
详细
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'