이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
n,m,r,t,k = map(int,input().split())
X = [None]* n
for _ in range(k):
u,v = map(int,input().split())
if(X[u-1] == None):
X[u-1] = [v]
else:
X[u-1].append(v)
max_level = 0
for i in X:
if i != None:
max_level = max(max_level,len(i))
tc = 0
solved = set()
answers = []
for level in range(max_level):
for j in range(len(X)):
if(X[j] != None and level < len(X[j])):
if(X[j][level] not in solved):
tc += (r + (level * r))
solved.add(X[j][level])
answers.append([j+1,X[j][level],level * r])
print(len(solved),tc)
for item in answers:
print(*item,end=' ')
print()
# | 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... |