제출 #764059

#제출 시각아이디문제언어결과실행 시간메모리
764059rithikkatyal새로운 문제 (POI11_pro)Cpython 3
0 / 100
290 ms6476 KiB
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 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...