이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
import sys
n, m, r, t, k = map(int, sys.stdin.readline().split())
problem_pair = []
for i in range(k):
problem_pair.append(map(int, sys.stdin.readline().split()))
users = {}
time = {}
total_time = r
for idx,(a,b) in enumerate(problem_pair):
if a not in users.keys():
users[a] = []
time[a] = 0
users[a].append((b, time[a]))
else:
users[a].append((b, time[a]))
time[a] += r
user_list = []
user_task = set()
for task in range(1,1+m):
for key, c in users.items():
for tsk in c:
tsk = (key, ) + tsk
user_task.add(tsk)
user_task = list(user_task)
user_task.sort(key = lambda x: x[2])
seen = {}
new_tuples = []
for tup in user_task:
if tup[1] not in seen:
new_tuples.append(tup)
seen[tup[1]] = True
print(len(new_tuples), sum(time.values())-r)
for task in new_tuples:
print(*task)
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |