message stringlengths 2 39.6k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 450 109k | cluster float64 2 2 | __index_level_0__ int64 900 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were written in an n× m table.
The table is lost now... | instruction | 0 | 71,843 | 2 | 143,686 |
Tags: implementation
Correct Solution:
```
from sys import stdin, stdout
input, print = stdin.readline, stdout.write
for __ in range(int(input())):
n, m = list(map(int, input().split()))
kek = []
for i in range(n):
el = list(map(int, input().split()))
el.append(0)
kek.append(el)
... | output | 1 | 71,843 | 2 | 143,687 |
Provide tags and a correct Python 3 solution for this coding contest problem.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were written in an n× m table.
The table is lost now... | instruction | 0 | 71,844 | 2 | 143,688 |
Tags: implementation
Correct Solution:
```
import sys as _sys
def main():
t = int(input())
for i_t in range(t):
rows_n, columns_n = _read_ints()
rows = [tuple(_read_ints()) for i_row in range(rows_n)]
columns = [tuple(_read_ints()) for i_column in range(columns_n)]
... | output | 1 | 71,844 | 2 | 143,689 |
Provide tags and a correct Python 3 solution for this coding contest problem.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were written in an n× m table.
The table is lost now... | instruction | 0 | 71,845 | 2 | 143,690 |
Tags: implementation
Correct Solution:
```
import sys
input=sys.stdin.readline
for _ in range(int(input())):
n,m=map(int, input().split())
r={}
for i in range(n):
l=list(map(int, input().split()))
r[l[0]]=l
c=l[0]
for i in range(m):
l=list(map(int, input().split()))
i... | output | 1 | 71,845 | 2 | 143,691 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were w... | instruction | 0 | 71,846 | 2 | 143,692 |
Yes | output | 1 | 71,846 | 2 | 143,693 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were w... | instruction | 0 | 71,847 | 2 | 143,694 |
Yes | output | 1 | 71,847 | 2 | 143,695 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were w... | instruction | 0 | 71,848 | 2 | 143,696 |
Yes | output | 1 | 71,848 | 2 | 143,697 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were w... | instruction | 0 | 71,849 | 2 | 143,698 |
Yes | output | 1 | 71,849 | 2 | 143,699 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were w... | instruction | 0 | 71,850 | 2 | 143,700 |
No | output | 1 | 71,850 | 2 | 143,701 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were w... | instruction | 0 | 71,851 | 2 | 143,702 |
No | output | 1 | 71,851 | 2 | 143,703 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were w... | instruction | 0 | 71,852 | 2 | 143,704 |
No | output | 1 | 71,852 | 2 | 143,705 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
All techniques in the ninja world consist of hand seals. At the moment Naruto is learning a new technique, which consists of n⋅ m different seals, denoted by distinct numbers. All of them were w... | instruction | 0 | 71,853 | 2 | 143,706 |
No | output | 1 | 71,853 | 2 | 143,707 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Fox Ciel is playing a card game with her friend Jiro.
Jiro has n cards, each one has two attributes: position (Attack or Defense) and strength. Fox Ciel has m cards, each one has these two attributes too. It's known that position of all Cie... | instruction | 0 | 71,983 | 2 | 143,966 |
Tags: dp, flows, greedy
Correct Solution:
```
n, m = map(int, input().split())
(a, d) = ([], [])
for i in range(n):
t, val = input().split()
(a if t == 'ATK' else d).append(int(val))
my = sorted([int(input()) for i in range(m)])
a.sort()
d.sort()
def solve1():
ret = 0
used = [False] * m
for val in ... | output | 1 | 71,983 | 2 | 143,967 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Fox Ciel is playing a card game with her friend Jiro.
Jiro has n cards, each one has two attributes: position (Attack or Defense) and strength. Fox Ciel has m cards, each one has these two attributes too. It's known that position of all Cie... | instruction | 0 | 71,984 | 2 | 143,968 |
Tags: dp, flows, greedy
Correct Solution:
```
import sys
n, m = map(int, input().split())
atk = []
dfs = []
for _ in range(n):
t, s = input().split()
(atk if t == "ATK" else dfs).append(int(s))
atk = sorted(atk)
dfs = sorted(dfs)
mine = sorted([int(input()) for _ in range(m)])
def s1():
ret = 0
done ... | output | 1 | 71,984 | 2 | 143,969 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Fox Ciel is playing a card game with her friend Jiro.
Jiro has n cards, each one has two attributes: position (Attack or Defense) and strength. Fox Ciel has m cards, each one has these two attributes too. It's known that position of all Cie... | instruction | 0 | 71,985 | 2 | 143,970 |
Tags: dp, flows, greedy
Correct Solution:
```
n, m = map(int, input().split())
(a, d) = ([], [])
for i in range(n):
t, val = input().split()
(a if t == 'ATK' else d).append(int(val))
my = sorted([int(input()) for i in range(m)])
a.sort()
d.sort()
def solve1():
ret = 0
used = [False] * m
for val in ... | output | 1 | 71,985 | 2 | 143,971 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Fox Ciel is playing a card game with her friend Jiro.
Jiro has n cards, each one has two attributes: position (Attack or Defense) and strength. Fox Ciel has m cards, each one has these two attributes too. It's known that position of all Cie... | instruction | 0 | 71,986 | 2 | 143,972 |
Tags: dp, flows, greedy
Correct Solution:
```
n, m = map(int, input().split())
(a, d, my) = ([], [], [])
for i in range(n):
t, val = input().split()
(a if t == 'ATK' else d).append(int(val))
my = sorted([int(input()) for i in range(m)])
a.sort()
d.sort()
def solve1():
ret = 0
used = [False] * m
... | output | 1 | 71,986 | 2 | 143,973 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within dista... | instruction | 0 | 72,083 | 2 | 144,166 |
Tags: binary search, dp
Correct Solution:
```
n = int(input())
a = [0]*1000001
last = 0
for i in range(n):
x,p = map(int,input().split())
a[x] = p
last = max(last,x)
dp = [0]*(last+1)
if a[0]!=0:
dp[0] = 1
#print(a)
for i in range(1,last+1):
if a[i] == 0:
dp[i] = dp[i-1]
else:
i... | output | 1 | 72,083 | 2 | 144,167 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within dista... | instruction | 0 | 72,084 | 2 | 144,168 |
Tags: binary search, dp
Correct Solution:
```
n = int(input())
a = [0]*1000001
b = [0]*1000001
for i in range(n):
l = list(map(int,input().split()))
a[l[0]] = 1
b[l[0]] = l[1]
notdestroyed = [0]*1000001
if a[0] == 1:
notdestroyed[0] = 1
for i in range(1,1000001):
if a[i] == 1:
notdestroyed[i] = notdest... | output | 1 | 72,084 | 2 | 144,169 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within dista... | instruction | 0 | 72,085 | 2 | 144,170 |
Tags: binary search, dp
Correct Solution:
```
from bisect import bisect_left, bisect_right
from collections import Counter
from collections import deque
from itertools import accumulate
import math
R = lambda: map(int, input().split())
n = int(input())
a, dp = sorted([tuple(R()) for _ in range(n)]), [0] * n
for i, (l... | output | 1 | 72,085 | 2 | 144,171 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within dista... | instruction | 0 | 72,086 | 2 | 144,172 |
Tags: binary search, dp
Correct Solution:
```
import bisect
n = int(input())
data = []
for _ in range(n):
data.append(list(map(int, input().split())))
data.sort(key=lambda x: x[0])
a = [x[0] for x in data]
b = [x[1] for x in data]
dp = [0] * n
dp[0] = 1
for i in range(1, n):
ind = bisect.bisect_left(a, a[i] - ... | output | 1 | 72,086 | 2 | 144,173 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within dista... | instruction | 0 | 72,087 | 2 | 144,174 |
Tags: binary search, dp
Correct Solution:
```
n = int(input())
lista = []
for i in range(n):
lista.append([int(x) for x in input().split()])
lista.sort()
diccionario = dict()
nada = True
last = 0
maximo = 0
for x, i in lista:
if nada == True:
for c in range(0, x):
diccionario[c] = 0
... | output | 1 | 72,087 | 2 | 144,175 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within dista... | instruction | 0 | 72,088 | 2 | 144,176 |
Tags: binary search, dp
Correct Solution:
```
maxN=1000001
b = [0]*maxN
dp = [0]*maxN
n = int(input())
mxA=0
for i in range(n):
a,p = [int(i) for i in input().split()]
b[a] = p
mxA = max(a,mxA)
if b[0] :
dp[0] = 1
mxSvd=0
for i in range(mxA+1) :
if not b[i] :
dp[i] = dp[i-1]
else :
... | output | 1 | 72,088 | 2 | 144,177 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within dista... | instruction | 0 | 72,089 | 2 | 144,178 |
Tags: binary search, dp
Correct Solution:
```
class Beacon:
def __init__(self, pos, span):
self.pos, self.span = pos, span
n = int(input())
beacons = [ Beacon(*map(int, input().split())) for i in range(n) ]
beacons.sort(key=lambda beacon: beacon.pos)
limit = beacons[-1].pos
slide = (limit + 1) * [ None ]
... | output | 1 | 72,089 | 2 | 144,179 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (direction of decreasing coordinates) within dista... | instruction | 0 | 72,090 | 2 | 144,180 |
Tags: binary search, dp
Correct Solution:
```
#------------------------------warmup----------------------------
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()... | output | 1 | 72,090 | 2 | 144,181 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (di... | instruction | 0 | 72,091 | 2 | 144,182 |
Yes | output | 1 | 72,091 | 2 | 144,183 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (di... | instruction | 0 | 72,093 | 2 | 144,186 |
Yes | output | 1 | 72,093 | 2 | 144,187 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (di... | instruction | 0 | 72,094 | 2 | 144,188 |
Yes | output | 1 | 72,094 | 2 | 144,189 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (di... | instruction | 0 | 72,095 | 2 | 144,190 |
No | output | 1 | 72,095 | 2 | 144,191 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (di... | instruction | 0 | 72,096 | 2 | 144,192 |
No | output | 1 | 72,096 | 2 | 144,193 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (di... | instruction | 0 | 72,097 | 2 | 144,194 |
No | output | 1 | 72,097 | 2 | 144,195 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n beacons located at distinct positions on a number line. The i-th beacon has position ai and power level bi. When the i-th beacon is activated, it destroys all beacons to its left (di... | instruction | 0 | 72,098 | 2 | 144,196 |
No | output | 1 | 72,098 | 2 | 144,197 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
As you might remember from our previous rounds, Vova really likes computer games. Now he is playing a strategy game known as Rage of Empires.
In the game Vova can hire n different warriors; ith... | instruction | 0 | 72,217 | 2 | 144,434 |
No | output | 1 | 72,217 | 2 | 144,435 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready for the attack of the White Walkers.
He has c... | instruction | 0 | 72,218 | 2 | 144,436 |
Tags: combinatorics, dp, math, number theory
Correct Solution:
```
n=int(input())
num=[0 for i in range(1000000+1)]
mx=0
for i in input().split(' '):
i=int(i)
mx=max(mx,i)
num[i]+=1
f=[0 for i in range(mx+1)]
p=[0 for i in range(mx+1)]
mod=1e9+7
p[0]=1
for i in range(1,mx+1):
p[i]=2*p[i-1]%mod
ans=0
for i in range(... | output | 1 | 72,218 | 2 | 144,437 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready for the attack of the White Walkers.
He has c... | instruction | 0 | 72,219 | 2 | 144,438 |
Tags: combinatorics, dp, math, number theory
Correct Solution:
```
n=int(input())
#num=[0 for i in range(1000000+1)]
num=[0]*(1000000+1)
mx=0
for i in input().split(' '):
i=int(i)
mx=max(mx,i)
num[i]+=1
#f=[0 for i in range(mx+1)]
#p=[0 for i in range(mx+1)]
f,p=[0]*(mx+1),[0]*(mx+1)
mod=1e9+7
p[0]=1
for i in range(... | output | 1 | 72,219 | 2 | 144,439 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready... | instruction | 0 | 72,220 | 2 | 144,440 |
No | output | 1 | 72,220 | 2 | 144,441 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready... | instruction | 0 | 72,221 | 2 | 144,442 |
No | output | 1 | 72,221 | 2 | 144,443 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready... | instruction | 0 | 72,222 | 2 | 144,444 |
No | output | 1 | 72,222 | 2 | 144,445 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready... | instruction | 0 | 72,223 | 2 | 144,446 |
No | output | 1 | 72,223 | 2 | 144,447 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Each item in the game has a level. The higher the level is, the higher basic parameters the item has. We shall consider only the following basic parameters: attack (atk), defense (def) and resistance to different types of impact (res).
Each... | instruction | 0 | 72,510 | 2 | 145,020 |
Tags: brute force, implementation, sortings
Correct Solution:
```
# written with help of failed tests
def searchBest(iType, number, rType, countResidents):
global items, equipped
best = 0
ret = None
for item, params in items.items():
if params[0] == iType:
val = int(params[number])
... | output | 1 | 72,510 | 2 | 145,021 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each item in the game has a level. The higher the level is, the higher basic parameters the item has. We shall consider only the following basic parameters: attack (atk), defense (def) and resis... | instruction | 0 | 72,511 | 2 | 145,022 |
No | output | 1 | 72,511 | 2 | 145,023 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each item in the game has a level. The higher the level is, the higher basic parameters the item has. We shall consider only the following basic parameters: attack (atk), defense (def) and resis... | instruction | 0 | 72,512 | 2 | 145,024 |
No | output | 1 | 72,512 | 2 | 145,025 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each item in the game has a level. The higher the level is, the higher basic parameters the item has. We shall consider only the following basic parameters: attack (atk), defense (def) and resis... | instruction | 0 | 72,513 | 2 | 145,026 |
No | output | 1 | 72,513 | 2 | 145,027 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Each item in the game has a level. The higher the level is, the higher basic parameters the item has. We shall consider only the following basic parameters: attack (atk), defense (def) and resis... | instruction | 0 | 72,514 | 2 | 145,028 |
No | output | 1 | 72,514 | 2 | 145,029 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but S... | instruction | 0 | 72,721 | 2 | 145,442 |
Tags: combinatorics, data structures, sortings
Correct Solution:
```
# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = Bytes... | output | 1 | 72,721 | 2 | 145,443 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but S... | instruction | 0 | 72,722 | 2 | 145,444 |
Tags: combinatorics, data structures, sortings
Correct Solution:
```
# Fast IO (be careful about bytestring, not on interactive)
import os,io
input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
n,k = map(int,input().split())
MOD = 998244353
# modular inverse for positive a and b and nCk mod MOD depending o... | output | 1 | 72,722 | 2 | 145,445 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but S... | instruction | 0 | 72,723 | 2 | 145,446 |
Tags: combinatorics, data structures, sortings
Correct Solution:
```
from bisect import *
from collections import *
from math import gcd,ceil,sqrt,floor,inf
from heapq import *
from typing import List
from itertools import *
from operator import add,mul,sub,xor,truediv,floordiv
from functools import *
#---------------... | output | 1 | 72,723 | 2 | 145,447 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but S... | instruction | 0 | 72,724 | 2 | 145,448 |
Tags: combinatorics, data structures, sortings
Correct Solution:
```
import sys
input = iter(sys.stdin.read().splitlines()).__next__
MOD = 998244353
n, k = map(int, input().split())
a = [tuple(map(int, input().split())) for _ in range(n)]
fac = [1] * (n + 1)
for i in range(2, n + 1):
fac[i] = fac[i - 1] * i % MO... | output | 1 | 72,724 | 2 | 145,449 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but S... | instruction | 0 | 72,725 | 2 | 145,450 |
Tags: combinatorics, data structures, sortings
Correct Solution:
```
# by the authority of GOD author: manhar singh sachdev #
import os,sys
from io import BytesIO, IOBase
from collections import defaultdict
mod = 998244353
fac = [1]
for i in range(1,300001):
fac.append((fac[-1]*i)%mod)
fac_in = [pow(fac[-1]... | output | 1 | 72,725 | 2 | 145,451 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but S... | instruction | 0 | 72,726 | 2 | 145,452 |
Tags: combinatorics, data structures, sortings
Correct Solution:
```
from functools import lru_cache
from sys import stdin, stdout
import sys
from math import *
# from collections import deque
# sys.setrecursionlimit(int(2e5+10))
input = stdin.readline
# print = stdout.write
# dp=[-1]*100000
N = 400000
factorialNumInv... | output | 1 | 72,726 | 2 | 145,453 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but S... | instruction | 0 | 72,727 | 2 | 145,454 |
Tags: combinatorics, data structures, sortings
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode o... | output | 1 | 72,727 | 2 | 145,455 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ori and Sein have overcome many difficult challenges. They finally lit the Shrouded Lantern and found Gumon Seal, the key to the Forlorn Ruins. When they tried to open the door to the ruins... nothing happened.
Ori was very surprised, but S... | instruction | 0 | 72,728 | 2 | 145,456 |
Tags: combinatorics, data structures, sortings
Correct Solution:
```
import sys
import math
import bisect
from sys import stdin, stdout
ip = lambda: int(stdin.readline())
inp = lambda: map(int, stdin.readline().split())
ips = lambda: stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + "\n")
def qpow(a, b... | output | 1 | 72,728 | 2 | 145,457 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.