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 = {}
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]))
time[a] += r
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), len(new_tuples) * r)
for task in new_tuples:
print(*task)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
38 ms |
3240 KB |
Your program calculated penalty of 6806000 points but it was possible to get no less than 20418000. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
27 ms |
3000 KB |
Your program calculated penalty of 37758415 points but it was possible to get no less than 55643980. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
72 ms |
3928 KB |
Integer 904122 violates the range [0, 0] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1063 ms |
10604 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1066 ms |
52256 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
38800 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1058 ms |
63740 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1068 ms |
11292 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1079 ms |
44720 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1066 ms |
16724 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |