message stringlengths 2 30.5k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 237 109k | cluster float64 10 10 | __index_level_0__ int64 474 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the products.
There are n cashiers at the exit from... | instruction | 0 | 30,433 | 10 | 60,866 |
Tags: implementation
Correct Solution:
```
def line_to_cashier(arr,b):
min=10000000000
for i in range(len(arr)):
tp=arr[i]*15
sum_array=sum(b[i])*5
total=tp+sum_array
#print(total)
if total<min:
final_ans=total
min=total
#print('_... | output | 1 | 30,433 | 10 | 60,867 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the products.
There are n cashiers at the exit from... | instruction | 0 | 30,434 | 10 | 60,868 |
Tags: implementation
Correct Solution:
```
god = 10**18
x = int(input())
items = list(map(int, input().split(' ')))
for i in range(x):
a = list(map(int, input().split(' ')))
god = min(god, sum(a)*5+15*items[i])
print(god)
``` | output | 1 | 30,434 | 10 | 60,869 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the products.
There are n cashiers at the exit from... | instruction | 0 | 30,435 | 10 | 60,870 |
Tags: implementation
Correct Solution:
```
n=int(input())
ans=1000005
l=list(map(int,input().split()))
for i in range(n):
ans=min(ans,sum(map(int,input().split()))*5+l[i]*15)
print(ans)
``` | output | 1 | 30,435 | 10 | 60,871 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the products.
There are n cashiers at the exit from... | instruction | 0 | 30,436 | 10 | 60,872 |
Tags: implementation
Correct Solution:
```
R = lambda:map(int,input().split())
n, = R()
print(min(15*k+5*sum(R())for k in R()))
``` | output | 1 | 30,436 | 10 | 60,873 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the products.
There are n cashiers at the exit from... | instruction | 0 | 30,437 | 10 | 60,874 |
Tags: implementation
Correct Solution:
```
n=int(input())
k=list(map(int,input().split()))
m=[]
for i in range(n):
m.append(list(map(int,input().split())))
k=0
f=[]
for i in m:
for j in range(len(i)):
k=k+(i[j]*5)+15
f.append(k)
k=0
a=min(f)
print(a)
``` | output | 1 | 30,437 | 10 | 60,875 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the p... | instruction | 0 | 30,438 | 10 | 60,876 |
Yes | output | 1 | 30,438 | 10 | 60,877 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the p... | instruction | 0 | 30,439 | 10 | 60,878 |
Yes | output | 1 | 30,439 | 10 | 60,879 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the p... | instruction | 0 | 30,440 | 10 | 60,880 |
Yes | output | 1 | 30,440 | 10 | 60,881 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the p... | instruction | 0 | 30,441 | 10 | 60,882 |
Yes | output | 1 | 30,441 | 10 | 60,883 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the p... | instruction | 0 | 30,442 | 10 | 60,884 |
No | output | 1 | 30,442 | 10 | 60,885 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the p... | instruction | 0 | 30,443 | 10 | 60,886 |
No | output | 1 | 30,443 | 10 | 60,887 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the p... | instruction | 0 | 30,444 | 10 | 60,888 |
No | output | 1 | 30,444 | 10 | 60,889 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Little Vasya went to the supermarket to get some groceries. He walked about the supermarket for a long time and got a basket full of products. Now he needs to choose the cashier to pay for the p... | instruction | 0 | 30,445 | 10 | 60,890 |
No | output | 1 | 30,445 | 10 | 60,891 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya we... | instruction | 0 | 30,462 | 10 | 60,924 |
Tags: implementation
Correct Solution:
```
if __name__ == '__main__':
m = {}
m['A'],m['B'],m['C'] = 0,0,0
for i in range(3):
st = str(input())
f,s = st[0],st[2]
if st[1] == '>':
m[f] += 1
else:
m[s] += 1
if(m['A'] == m['B'] == m['C'] == 1):
... | output | 1 | 30,462 | 10 | 60,925 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya we... | instruction | 0 | 30,463 | 10 | 60,926 |
Tags: implementation
Correct Solution:
```
n1 = input()
n2 = input()
n3 = input()
if n1[1] == ">":
n1 = n1[2] + "<" + n1[0]
if n2[1] == ">":
n2 = n2[2] + "<" + n2[0]
if n3[1] == ">":
n3 = n3[2] + "<" + n3[0]
if n1[0] != n2[0] and n1[0] != n3[0] and n3[0] != n2[0]:
print("Impossible")
elif n1[0] == n2[... | output | 1 | 30,463 | 10 | 60,927 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya we... | instruction | 0 | 30,464 | 10 | 60,928 |
Tags: implementation
Correct Solution:
```
vals = []
for _ in range(3):
vals.append(input())
valid = True
indexes = {"A":0, "B":0, "C":0}
a, b, c = 0, 0, 0
for i in range(3):
current = vals[i]
if current[1] == "<":
indexes[current[2]] += 1
else:
indexes[current[0]] += 1
string = [False... | output | 1 | 30,464 | 10 | 60,929 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya we... | instruction | 0 | 30,465 | 10 | 60,930 |
Tags: implementation
Correct Solution:
```
coins = ['ABC', 'ACB', 'BAC', 'BCA', 'CAB', 'CBA']
results = []
for i in range(0, 3):
results.append(input())
ans = 'Impossible'
for i in range(0, 6):
place = [0, 0, 0]
for j in range(0, 3):
place[ord(coins[i][j])-65] = j
flag = True
for j in range(0, 3):
if results[j... | output | 1 | 30,465 | 10 | 60,931 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya we... | instruction | 0 | 30,466 | 10 | 60,932 |
Tags: implementation
Correct Solution:
```
import operator
import sys
dec = {'A': 0, 'B': 0, 'C': 0}
x = [input(), input(), input()]
for i in range(3):
if x[i][1] == '>':
dec[x[i][0]] += 1
else:
dec[x[i][2]] += 1
if dec['A'] == dec['B'] or dec['A'] == dec['C'] or dec['C'] == dec['B']:
prin... | output | 1 | 30,466 | 10 | 60,933 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya we... | instruction | 0 | 30,467 | 10 | 60,934 |
Tags: implementation
Correct Solution:
```
#
# Author: eloyhz
# Date: Sep/11/2020
#
#
#
#
def read_weight():
w = list(input())
if w[1] == '>':
w[1] = '<'
w[0], w[2] = w[2], w[0]
return ''.join(w)
if __name__ == '__main__':
coins = [['ABC', 'A<B', 'A<C', 'B<C'],
['ACB', 'A... | output | 1 | 30,467 | 10 | 60,935 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya we... | instruction | 0 | 30,468 | 10 | 60,936 |
Tags: implementation
Correct Solution:
```
def top_sort(graph, visited, node, result):
if node in visited: return
visited.add(node)
for sub_node in graph[node]: top_sort(graph, visited, sub_node, result)
result.append(node)
def solve():
graph, visited, result = {'A':[], 'B':[], 'C':[]}, set([]), ... | output | 1 | 30,468 | 10 | 60,937 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the other one, then it should be worth more. Vasya we... | instruction | 0 | 30,469 | 10 | 60,938 |
Tags: implementation
Correct Solution:
```
from operator import itemgetter
list_ = [{'A': 0, 'B': 1, 'C': 2}, {'A': 0, 'B': 2, 'C': 1}, {'A': 1, 'B': 0, 'C': 2}, {'A': 1, 'B': 2, 'C': 0},
{'A': 2, 'B': 0, 'C': 1}, {'A': 2, 'B': 1, 'C': 0}]
expression = [input() for _ in range(3)]
def is_true(a, index) -> Tr... | output | 1 | 30,469 | 10 | 60,939 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the ot... | instruction | 0 | 30,470 | 10 | 60,940 |
Yes | output | 1 | 30,470 | 10 | 60,941 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the ot... | instruction | 0 | 30,471 | 10 | 60,942 |
Yes | output | 1 | 30,471 | 10 | 60,943 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the ot... | instruction | 0 | 30,472 | 10 | 60,944 |
Yes | output | 1 | 30,472 | 10 | 60,945 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the ot... | instruction | 0 | 30,473 | 10 | 60,946 |
Yes | output | 1 | 30,473 | 10 | 60,947 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the ot... | instruction | 0 | 30,474 | 10 | 60,948 |
No | output | 1 | 30,474 | 10 | 60,949 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the ot... | instruction | 0 | 30,475 | 10 | 60,950 |
No | output | 1 | 30,475 | 10 | 60,951 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the ot... | instruction | 0 | 30,476 | 10 | 60,952 |
No | output | 1 | 30,476 | 10 | 60,953 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day Vasya came across three Berland coins. They didn't have any numbers that's why Vasya didn't understand how their denominations differ. He supposed that if one coin is heavier than the ot... | instruction | 0 | 30,477 | 10 | 60,954 |
No | output | 1 | 30,477 | 10 | 60,955 |
Provide a correct Python 3 solution for this coding contest problem.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).
He has a discount coupon, and can buy one item ... | instruction | 0 | 30,767 | 10 | 61,534 |
"Correct Solution:
```
N = int(input())
P = [int(input()) for n in range(N)]
print(sum(P) - max(P) // 2)
``` | output | 1 | 30,767 | 10 | 61,535 |
Provide a correct Python 3 solution for this coding contest problem.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).
He has a discount coupon, and can buy one item ... | instruction | 0 | 30,768 | 10 | 61,536 |
"Correct Solution:
```
n=int(input())
l=[int(input()) for _ in range(n)]
print(sum(l)-max(l)//2)
``` | output | 1 | 30,768 | 10 | 61,537 |
Provide a correct Python 3 solution for this coding contest problem.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).
He has a discount coupon, and can buy one item ... | instruction | 0 | 30,769 | 10 | 61,538 |
"Correct Solution:
```
n,*p=list(map(int,open(0).read().split()))
p.sort()
print(sum(p[:-1])+p[-1]//2)
``` | output | 1 | 30,769 | 10 | 61,539 |
Provide a correct Python 3 solution for this coding contest problem.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).
He has a discount coupon, and can buy one item ... | instruction | 0 | 30,770 | 10 | 61,540 |
"Correct Solution:
```
n = int(input())
l = [int(input()) for _ in [0]*n]
print(sum(l)-max(l)//2)
``` | output | 1 | 30,770 | 10 | 61,541 |
Provide a correct Python 3 solution for this coding contest problem.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).
He has a discount coupon, and can buy one item ... | instruction | 0 | 30,771 | 10 | 61,542 |
"Correct Solution:
```
pn=[int(input()) for _ in range(int(input()))]
print(sum(pn)-max(pn)//2)
``` | output | 1 | 30,771 | 10 | 61,543 |
Provide a correct Python 3 solution for this coding contest problem.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).
He has a discount coupon, and can buy one item ... | instruction | 0 | 30,772 | 10 | 61,544 |
"Correct Solution:
```
P = [int(input()) for _ in range(int(input()))]
p = max(P)
print(sum(P)-int(p//2))
``` | output | 1 | 30,772 | 10 | 61,545 |
Provide a correct Python 3 solution for this coding contest problem.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).
He has a discount coupon, and can buy one item ... | instruction | 0 | 30,773 | 10 | 61,546 |
"Correct Solution:
```
n=int(input());p=[int(input())for i in range(n)];print(sum(p)-round(max(p)/2))
``` | output | 1 | 30,773 | 10 | 61,547 |
Provide a correct Python 3 solution for this coding contest problem.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of Japan).
He has a discount coupon, and can buy one item ... | instruction | 0 | 30,774 | 10 | 61,548 |
"Correct Solution:
```
n=int(input())
a=[int(input()) for i in range(n)]
print(sum(a)-max(a)//2)
``` | output | 1 | 30,774 | 10 | 61,549 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of ... | instruction | 0 | 30,775 | 10 | 61,550 |
Yes | output | 1 | 30,775 | 10 | 61,551 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of ... | instruction | 0 | 30,776 | 10 | 61,552 |
Yes | output | 1 | 30,776 | 10 | 61,553 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of ... | instruction | 0 | 30,777 | 10 | 61,554 |
Yes | output | 1 | 30,777 | 10 | 61,555 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of ... | instruction | 0 | 30,778 | 10 | 61,556 |
Yes | output | 1 | 30,778 | 10 | 61,557 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of ... | instruction | 0 | 30,779 | 10 | 61,558 |
No | output | 1 | 30,779 | 10 | 61,559 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of ... | instruction | 0 | 30,780 | 10 | 61,560 |
No | output | 1 | 30,780 | 10 | 61,561 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of ... | instruction | 0 | 30,781 | 10 | 61,562 |
No | output | 1 | 30,781 | 10 | 61,563 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In some other world, today is the day before Christmas Eve.
Mr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \leq i \leq N) is p_i yen (the currency of ... | instruction | 0 | 30,782 | 10 | 61,564 |
No | output | 1 | 30,782 | 10 | 61,565 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are m people living in a city. There are n dishes sold in the city. Each dish i has a price p_i, a standard s_i and a beauty b_i. Each person j has an income of inc_j and a preferred beaut... | instruction | 0 | 31,025 | 10 | 62,050 |
No | output | 1 | 31,025 | 10 | 62,051 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are m people living in a city. There are n dishes sold in the city. Each dish i has a price p_i, a standard s_i and a beauty b_i. Each person j has an income of inc_j and a preferred beaut... | instruction | 0 | 31,026 | 10 | 62,052 |
No | output | 1 | 31,026 | 10 | 62,053 |
Provide tags and a correct Python 3 solution for this coding contest problem.
<image>
To monitor cryptocurrency exchange rates trader William invented a wonderful device consisting of n lights arranged in a row. The device functions in the following way:
Initially, all lights on William's device are turned off. At t... | instruction | 0 | 31,233 | 10 | 62,466 |
Tags: combinatorics, dp, math, probabilities
Correct Solution:
```
from bisect import bisect,bisect_left
from collections import *
from heapq import *
from math import gcd,ceil,sqrt,floor,inf
from itertools import *
from operator import add,mul,sub,xor,truediv,floordiv
from functools import *
#--------------------... | output | 1 | 31,233 | 10 | 62,467 |
Provide tags and a correct Python 3 solution for this coding contest problem.
<image>
To monitor cryptocurrency exchange rates trader William invented a wonderful device consisting of n lights arranged in a row. The device functions in the following way:
Initially, all lights on William's device are turned off. At t... | instruction | 0 | 31,234 | 10 | 62,468 |
Tags: combinatorics, dp, math, probabilities
Correct Solution:
```
import sys
input=sys.stdin.readline
max_n=2*10**5
fact, inv_fact = [0] * (max_n+1), [0] * (max_n+1)
fact[0] = 1
mod=10**9+7
def make_nCr_mod():
global fact
global inv_fact
for i in range(max_n):
fact[i + 1] = fact[i] * (i + 1) % mod... | output | 1 | 31,234 | 10 | 62,469 |
Provide tags and a correct Python 3 solution for this coding contest problem.
<image>
To monitor cryptocurrency exchange rates trader William invented a wonderful device consisting of n lights arranged in a row. The device functions in the following way:
Initially, all lights on William's device are turned off. At t... | instruction | 0 | 31,235 | 10 | 62,470 |
Tags: combinatorics, dp, math, probabilities
Correct Solution:
```
from __future__ import division, print_function
import sys, collections, math, itertools, random, bisect
# sys.stdout = open('C:/Users/welcome/Desktop/sublime/output.txt', 'w')
# sys.stdin = open('C:/Users/welcome/Desktop/sublime/input.txt', 'r')
INF = ... | output | 1 | 31,235 | 10 | 62,471 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.