제출 #754387

#제출 시각아이디문제언어결과실행 시간메모리
754387komalrajputtrootech새로운 문제 (POI11_pro)Cpython 3
0 / 100
325 ms3012 KiB
n, m, r, t, k = map(int, input().split()) problems_solved = [0] * n time_remaining = [t] * m contestant_assigned = [-1] * m starting_time = [-1] * m for _ in range(k): a, b = map(int, input().split()) a -= 1 # Adjust index to 0-based b -= 1 # Adjust index to 0-based contestant_assigned[b] = a for problem in range(m - 1, -1, -1): for contestant in range(n): if contestant_assigned[problem] == -1 and time_remaining[problem] >= r: if contestant in range(n) and problem in range(m): problems_solved[contestant] += 1 time_remaining[problem] -= r contestant_assigned[problem] = contestant starting_time[problem] = t - time_remaining[problem] break total_penal_points = sum(starting_time) print(sum(problems_solved), total_penal_points) for problem in range(m): if starting_time[problem] != -1: print(contestant_assigned[problem] + 1, problem + 1, starting_time[problem])
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...