message
stringlengths
2
45.8k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
254
108k
cluster
float64
3
3
__index_level_0__
int64
508
217k
Provide a correct Python 3 solution for this coding contest problem. During a voyage of the starship Hakodate-maru (see Problem A), researchers found strange synchronized movements of stars. Having heard these observations, Dr. Extreme proposed a theory of "super stars". Do not take this term as a description of actor...
instruction
0
101,995
3
203,990
"Correct Solution: ``` while True: n = int(input()) if not n: break star = [list(map(float, input().split())) for i in range(n)] start = [0.0, 0.0, 0.0] move = 0.5 for _ in range(500): for j in range(100): tmpmax = 0 a = 0 for i in range(n):...
output
1
101,995
3
203,991
Provide tags and a correct Python 3 solution for this coding contest problem. This is an interactive problem. Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arrive to Mars already! So she decides to find something to occupy herself. She couldn't ...
instruction
0
102,032
3
204,064
Tags: binary search, interactive Correct Solution: ``` from sys import stdin from math import * from sys import stdout line = stdin.readline().rstrip().split() m = int(line[0]) n = int(line[1]) bits = [] for i in range(n): print(m) stdout.flush() line = stdin.readline().rstrip().split() res = int(line...
output
1
102,032
3
204,065
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This is an interactive problem. Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arrive to Mars already! So she decides to ...
instruction
0
102,033
3
204,066
No
output
1
102,033
3
204,067
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This is an interactive problem. Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arrive to Mars already! So she decides to ...
instruction
0
102,034
3
204,068
No
output
1
102,034
3
204,069
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This is an interactive problem. Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arrive to Mars already! So she decides to ...
instruction
0
102,035
3
204,070
No
output
1
102,035
3
204,071
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. This is an interactive problem. Natasha is going to fly to Mars. Finally, Natasha sat in the rocket. She flies, flies... but gets bored. She wishes to arrive to Mars already! So she decides to ...
instruction
0
102,036
3
204,072
No
output
1
102,036
3
204,073
Provide tags and a correct Python 3 solution for this coding contest problem. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best ...
instruction
0
102,333
3
204,666
Tags: greedy, sortings Correct Solution: ``` n, t1, t2, k=map(int, input().split(' ')) nums=[[0, 0] for t in range(n)] for line in range(n): a, b=map(int, input().split(' ')) nums[line][0]=max(a*t2+b*(t1*(1-k/100)), b*t2+a*(t1*(1-k/100))) nums[line][1]=13379001-line nums.sort() nums.reverse() for a i...
output
1
102,333
3
204,667
Provide tags and a correct Python 3 solution for this coding contest problem. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best ...
instruction
0
102,334
3
204,668
Tags: greedy, sortings Correct Solution: ``` n,t1,t2,k=map(int,input().split()) k=k/100 c=[] for i in range(n): a,b=map(int,input().split()) cal=max((a*t1)-(a*t1*k)+(b*t2),(b*t1)-(b*t1*k)+(a*t2)) c.append((i+1,cal)) # print(c) c.sort(key=lambda x:x[1],reverse=True) # print(c) for i in c: pr...
output
1
102,334
3
204,669
Provide tags and a correct Python 3 solution for this coding contest problem. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best ...
instruction
0
102,335
3
204,670
Tags: greedy, sortings Correct Solution: ``` '''http://codeforces.com/contest/186/problem/B''' n,t1,t2,k = map(int, input().split(" ")) factor = 1- (k/100) listX = [] for i in range(n): a,b = map(int, input().split(" ")) maxX = max(((a*t1*factor) + (b*t2)),((b*t1*factor)+(a*t2))) # print(maxX) listX.app...
output
1
102,335
3
204,671
Provide tags and a correct Python 3 solution for this coding contest problem. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best ...
instruction
0
102,336
3
204,672
Tags: greedy, sortings Correct Solution: ``` n, t1, t2, k = [int(i) for i in input().split()] ans = [] for i in range(n): v, u = [int(i) for i in input().split()] h = max(v*t1*(100 - k)/100 + u*t2, u*t1*(100 - k)/100 + v*t2) ans.append((i, h)) ans.sort(key = lambda x : x[1] , reverse = True...
output
1
102,336
3
204,673
Provide tags and a correct Python 3 solution for this coding contest problem. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best ...
instruction
0
102,337
3
204,674
Tags: greedy, sortings Correct Solution: ``` n, t1, t2, k = list(map(int, input().split())) rank = [] for seed_grower in range(n): speed1, speed2 = list(map(int, input().split())) var1 = speed1 * t1 * (1-(k/100)) + speed2 * t2 var2 = speed2 * t1 * (1-(k/100)) + speed1 * t2 total = max(var1, var2) ra...
output
1
102,337
3
204,675
Provide tags and a correct Python 3 solution for this coding contest problem. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best ...
instruction
0
102,338
3
204,676
Tags: greedy, sortings Correct Solution: ``` n,t1,t2,k=map(int,input().split()) lst=[] for i in range(n): a,b=map(int,input().split()) lst.append((-max((a*t1*((100-k)/100)+b*t2),(b*t1*((100-k)/100)+a*t2)),i+1)) lst.sort() for i in range(n): print('%d %.2f'%(lst[i][1],-lst[i][0])) ```
output
1
102,338
3
204,677
Provide tags and a correct Python 3 solution for this coding contest problem. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best ...
instruction
0
102,339
3
204,678
Tags: greedy, sortings Correct Solution: ``` # ip = open("testdata.txt", "r") # def input(): # return ip.readline().strip() n, t1, t2, k = map(int, input().split()) arr = [0]*n redn = (100-k)/100 for i in range(n): a, b = map(int, input().split()) res = max(t1*a*redn + t2*b, t1*b*redn + t2*a) arr[i] = [i+1, res]...
output
1
102,339
3
204,679
Provide tags and a correct Python 3 solution for this coding contest problem. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bowl. This year's event brought together the best ...
instruction
0
102,340
3
204,680
Tags: greedy, sortings Correct Solution: ``` """ Problem link: Solution By Keshav Mishra """ from sys import stdin,stdout from collections import Counter , deque from queue import PriorityQueue import math helperConstants = True helperUtilityFunctions = True def input(): return stdin.readline().strip() # def pri...
output
1
102,340
3
204,681
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bow...
instruction
0
102,341
3
204,682
Yes
output
1
102,341
3
204,683
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bow...
instruction
0
102,342
3
204,684
Yes
output
1
102,342
3
204,685
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bow...
instruction
0
102,343
3
204,686
Yes
output
1
102,343
3
204,687
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bow...
instruction
0
102,344
3
204,688
Yes
output
1
102,344
3
204,689
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bow...
instruction
0
102,345
3
204,690
No
output
1
102,345
3
204,691
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bow...
instruction
0
102,346
3
204,692
No
output
1
102,346
3
204,693
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bow...
instruction
0
102,347
3
204,694
No
output
1
102,347
3
204,695
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Each year in the castle of Dwarven King there is a competition in growing mushrooms among the dwarves. The competition is one of the most prestigious ones, and the winner gets a wooden salad bow...
instruction
0
102,348
3
204,696
No
output
1
102,348
3
204,697
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We...
instruction
0
102,410
3
204,820
Yes
output
1
102,410
3
204,821
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We...
instruction
0
102,411
3
204,822
Yes
output
1
102,411
3
204,823
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We...
instruction
0
102,412
3
204,824
Yes
output
1
102,412
3
204,825
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We...
instruction
0
102,413
3
204,826
Yes
output
1
102,413
3
204,827
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We...
instruction
0
102,414
3
204,828
No
output
1
102,414
3
204,829
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We...
instruction
0
102,415
3
204,830
No
output
1
102,415
3
204,831
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We...
instruction
0
102,416
3
204,832
No
output
1
102,416
3
204,833
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a description of a lever as string s. We'll represent the string length as record |s|, then the lever looks as a horizontal bar with weights of length |s| - 1 with exactly one pivot. We...
instruction
0
102,417
3
204,834
No
output
1
102,417
3
204,835
Provide tags and a correct Python 3 solution for this coding contest problem. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is th...
instruction
0
102,490
3
204,980
Tags: implementation, math Correct Solution: ``` from collections import * from itertools import * from random import * from bisect import * from string import * from queue import * from heapq import * from math import * from re import * from sys import * def fast(): return stdin.readline().strip() def zzz(): return [i...
output
1
102,490
3
204,981
Provide tags and a correct Python 3 solution for this coding contest problem. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is th...
instruction
0
102,491
3
204,982
Tags: implementation, math Correct Solution: ``` n=int(input()) a=[];v=[];o=0 a=list(map(int,input().split())) for i in range(0,n+1): v.append(0) for i in range(n): v[a[i]]=i+1 for i in range(1,n): o+=abs(v[i]-v[i+1]) print(o) ```
output
1
102,491
3
204,983
Provide tags and a correct Python 3 solution for this coding contest problem. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is th...
instruction
0
102,492
3
204,984
Tags: implementation, math Correct Solution: ``` n=int(input()) k=0 a=list(map(int,input().split())) b=[0]*1000000 for i in range(n): b[a[i]-1]=i for i in range(n-1): k+=abs(b[i]-b[i+1]) print(k) ```
output
1
102,492
3
204,985
Provide tags and a correct Python 3 solution for this coding contest problem. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is th...
instruction
0
102,493
3
204,986
Tags: implementation, math Correct Solution: ``` n= int(input()) arr= list(map(int,input().split())) map={} for i in range(n): map[arr[i]]=i+1 ans=0 for i in range(1,n): ans+=abs(map[i]-map[i+1]) print (ans) ```
output
1
102,493
3
204,987
Provide tags and a correct Python 3 solution for this coding contest problem. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is th...
instruction
0
102,494
3
204,988
Tags: implementation, math Correct Solution: ``` R = lambda : map(int, input().split()) n = int(input()) v = list(R()) d = {} for i in range(n): d[v[i]] = i c = 0 for i in range(2,n+1): c += abs(d[i]-d[i-1]) print(c) ```
output
1
102,494
3
204,989
Provide tags and a correct Python 3 solution for this coding contest problem. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is th...
instruction
0
102,495
3
204,990
Tags: implementation, math Correct Solution: ``` n = int(input()) L = list(map(int,input().split())) A = [] for i in range(n): A.append([L[i],i]) A.sort() cnt = 0 for i in range(1,n): cnt += abs(A[i][1] - A[i-1][1]) print(cnt) ```
output
1
102,495
3
204,991
Provide tags and a correct Python 3 solution for this coding contest problem. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is th...
instruction
0
102,496
3
204,992
Tags: implementation, math Correct Solution: ``` def hdd(n, lst): res, answer = [0] * n, 0 for i in range(n): res[lst[i] - 1] = i for i in range(n - 1): answer += abs(res[i] - res[i + 1]) return answer m = int(input()) a = [int(j) for j in input().split()] print(hdd(m, a)) ```
output
1
102,496
3
204,993
Provide tags and a correct Python 3 solution for this coding contest problem. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order. One of the problems of HDD hard drives is th...
instruction
0
102,497
3
204,994
Tags: implementation, math Correct Solution: ``` n=int(input()) ls=list(map(int,input().split())) arr=[0]*n for x in range(n): arr[ls[x]-1]=x su=0 for x in range(1,n): su+=abs(arr[x]-arr[x-1]) print(su) ```
output
1
102,497
3
204,995
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order...
instruction
0
102,498
3
204,996
Yes
output
1
102,498
3
204,997
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order...
instruction
0
102,499
3
204,998
Yes
output
1
102,499
3
204,999
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order...
instruction
0
102,500
3
205,000
Yes
output
1
102,500
3
205,001
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order...
instruction
0
102,501
3
205,002
Yes
output
1
102,501
3
205,003
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order...
instruction
0
102,502
3
205,004
No
output
1
102,502
3
205,005
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order...
instruction
0
102,503
3
205,006
No
output
1
102,503
3
205,007
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order...
instruction
0
102,504
3
205,008
No
output
1
102,504
3
205,009
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. HDD hard drives group data by sectors. All files are split to fragments and each of them are written in some sector of hard drive. Note the fragments can be written in sectors in arbitrary order...
instruction
0
102,505
3
205,010
No
output
1
102,505
3
205,011
Provide tags and a correct Python 3 solution for this coding contest problem. After a successful field test, Heidi is considering deploying a trap along some Corridor, possibly not the first one. She wants to avoid meeting the Daleks inside the Time Vortex, so for abundance of caution she considers placing the traps o...
instruction
0
102,972
3
205,944
Tags: dfs and similar, graphs, shortest paths, trees Correct Solution: ``` def naiveSolve(): return from types import GeneratorType def bootstrap(f, stack=[]): def wrappedfunc(*args, **kwargs): if stack: return f(*args, **kwargs) else: to = f(*args, **kwar...
output
1
102,972
3
205,945
Provide tags and a correct Python 3 solution for this coding contest problem. After a successful field test, Heidi is considering deploying a trap along some Corridor, possibly not the first one. She wants to avoid meeting the Daleks inside the Time Vortex, so for abundance of caution she considers placing the traps o...
instruction
0
102,973
3
205,946
Tags: dfs and similar, graphs, shortest paths, trees Correct Solution: ``` def naiveSolve(): return from types import GeneratorType def bootstrap(f, stack=[]): def wrappedfunc(*args, **kwargs): if stack: return f(*args, **kwargs) else: to = f(*args, **kwar...
output
1
102,973
3
205,947
Provide tags and a correct Python 3 solution for this coding contest problem. After a successful field test, Heidi is considering deploying a trap along some Corridor, possibly not the first one. She wants to avoid meeting the Daleks inside the Time Vortex, so for abundance of caution she considers placing the traps o...
instruction
0
102,974
3
205,948
Tags: dfs and similar, graphs, shortest paths, trees Correct Solution: ``` def naiveSolve(): return from types import GeneratorType def bootstrap(f, stack=[]): def wrappedfunc(*args, **kwargs): if stack: return f(*args, **kwargs) else: to = f(*args, **kwar...
output
1
102,974
3
205,949
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. After a successful field test, Heidi is considering deploying a trap along some Corridor, possibly not the first one. She wants to avoid meeting the Daleks inside the Time Vortex, so for abundan...
instruction
0
102,975
3
205,950
No
output
1
102,975
3
205,951