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] += 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()))
for task in new_tuples:
print(*task)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
40 ms |
3156 KB |
Expected integer, but "126289090843266202320" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
2932 KB |
Expected int32, but "3125601848" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
86 ms |
3964 KB |
Expected int32, but "389576706680509920" found |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1075 ms |
10624 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1083 ms |
52196 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1075 ms |
38812 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1069 ms |
63688 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1066 ms |
11340 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1077 ms |
44724 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1065 ms |
16748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |