message stringlengths 2 28.7k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 21 109k | cluster float64 7 7 | __index_level_0__ int64 42 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya and Petya have invented a new game. Vasya takes a stripe consisting of 1 × n square and paints the squares black and white. After that Petya can start moves — during a move he may choose a... | instruction | 0 | 94,793 | 7 | 189,586 |
Yes | output | 1 | 94,793 | 7 | 189,587 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya and Petya have invented a new game. Vasya takes a stripe consisting of 1 × n square and paints the squares black and white. After that Petya can start moves — during a move he may choose a... | instruction | 0 | 94,794 | 7 | 189,588 |
Yes | output | 1 | 94,794 | 7 | 189,589 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya and Petya have invented a new game. Vasya takes a stripe consisting of 1 × n square and paints the squares black and white. After that Petya can start moves — during a move he may choose a... | instruction | 0 | 94,795 | 7 | 189,590 |
Yes | output | 1 | 94,795 | 7 | 189,591 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya and Petya have invented a new game. Vasya takes a stripe consisting of 1 × n square and paints the squares black and white. After that Petya can start moves — during a move he may choose a... | instruction | 0 | 94,796 | 7 | 189,592 |
No | output | 1 | 94,796 | 7 | 189,593 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya and Petya have invented a new game. Vasya takes a stripe consisting of 1 × n square and paints the squares black and white. After that Petya can start moves — during a move he may choose a... | instruction | 0 | 94,797 | 7 | 189,594 |
No | output | 1 | 94,797 | 7 | 189,595 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya and Petya have invented a new game. Vasya takes a stripe consisting of 1 × n square and paints the squares black and white. After that Petya can start moves — during a move he may choose a... | instruction | 0 | 94,798 | 7 | 189,596 |
No | output | 1 | 94,798 | 7 | 189,597 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya and Petya have invented a new game. Vasya takes a stripe consisting of 1 × n square and paints the squares black and white. After that Petya can start moves — during a move he may choose a... | instruction | 0 | 94,799 | 7 | 189,598 |
No | output | 1 | 94,799 | 7 | 189,599 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the tower as follows:
* The beaut... | instruction | 0 | 95,099 | 7 | 190,198 |
"Correct Solution:
```
# 解説AC
class Combination():
def __init__(self, N:int, P:int):
self.N = N
self.P = P
# fact[i] = (i! mod P)
self.fact = [1, 1]
# factinv[i] = ((i!)^(-1) mod P)
self.factinv = [1, 1]
# factinv 計算用
self.inv = [0, 1]
for i i... | output | 1 | 95,099 | 7 | 190,199 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the tower as follows:
* The beaut... | instruction | 0 | 95,100 | 7 | 190,200 |
"Correct Solution:
```
n,a,b,k=map(int,input().split())
p=998244353
def getinv(n):
inv=[0]*(n+1)
for i in range(1,n+1):
inv[i]=pow(i,p-2,p)
return inv
def getnCr(n):
inv=getinv(n)
nCr=[0]*(n+1)
nCr[0]=1
for i in range(1,n+1):
nCr[i]=(nCr[i-1]*(n-i+1)*inv[i])%p
return nCr
def solve(n,a,b,k):
an... | output | 1 | 95,100 | 7 | 190,201 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the tower as follows:
* The beaut... | instruction | 0 | 95,101 | 7 | 190,202 |
"Correct Solution:
```
def combs_mod(n,k,mod):
#nC0からnCkまで
inv = [1]*(k+1)
for i in range(1,k+1):
inv[i] = pow(i,mod-2,mod)
ans = [1]*(k+1)
for i in range(1,k+1):
ans[i] = ans[i-1]*(n+1-i)*inv[i]%mod
return ans
def solve():
mod = 998244353
N, A, B, K = map(int, input().split())
com = combs_mod... | output | 1 | 95,101 | 7 | 190,203 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the tower as follows:
* The beaut... | instruction | 0 | 95,102 | 7 | 190,204 |
"Correct Solution:
```
n,a,b,k = map(int,input().split())
mod = 998244353
def factorial(N, MOD, r=True):
fact = [1] * (N + 1)
rfact = [1] * (N + 1)
r = 1
for i in range(1, N + 1):
fact[i] = r = r * i % MOD
rfact[N] = r = pow(fact[N], MOD - 2, MOD)
for i in range(N, 0, -1):
rfac... | output | 1 | 95,102 | 7 | 190,205 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the tower as follows:
* The beaut... | instruction | 0 | 95,103 | 7 | 190,206 |
"Correct Solution:
```
N, A, B, K = map(int, input().split())
maxAB = max(A, B)
minAB = min(A, B)
ans = 0
def cmb(n, r):
if (r < 0 or r > n):
return 0
r = min(r, n-r)
return fac[n] * finv[r] * finv[n-r] % mod
mod = 998244353 # 問題によって変える、ここは素数でないとうまく動かない
N_cmb = 0
N_cmb += N # 入力の制約によって変えるところ、n... | output | 1 | 95,103 | 7 | 190,207 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the tower as follows:
* The beaut... | instruction | 0 | 95,104 | 7 | 190,208 |
"Correct Solution:
```
M=998244353;n,A,B,K=map(int,input().split());F=[1];a=0
for i in range(n):F+=[F[-1]*(n-i)*pow(i+1,M-2,M)%M]
for i in range(n+1):
q,r=divmod(K-i*A,B)
if(r==0)&(0<=q<=n):a+=F[i]*F[q]
print(a%M)
``` | output | 1 | 95,104 | 7 | 190,209 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the tower as follows:
* The beaut... | instruction | 0 | 95,105 | 7 | 190,210 |
"Correct Solution:
```
M=998244353;n,A,B,K=map(int,input().split());F=[1];a=0
for i in range(n):F+=[F[-1]*(n-i)*pow(i+1,M-2,M)%M]
for i in range(n+1):
r=K-i*A
if(r%B==0)&(0<=r//B<=n):a+=F[i]*F[r//B]
print(a%M)
``` | output | 1 | 95,105 | 7 | 190,211 |
Provide a correct Python 3 solution for this coding contest problem.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the tower as follows:
* The beaut... | instruction | 0 | 95,106 | 7 | 190,212 |
"Correct Solution:
```
MOD = 998244353
n, a, b, k = map(int, input().split())
fac = [1] * (n + 1)
for i in range(n):
fac[i + 1] = fac[i] * (i + 1) % MOD
def comb(n, k):
return fac[n] * pow(fac[n - k], MOD - 2, MOD) * pow(fac[k], MOD - 2, MOD)
ans = 0
for x in range(n + 1):
if k - x * a < 0 or (k - x * a... | output | 1 | 95,106 | 7 | 190,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He ... | instruction | 0 | 95,107 | 7 | 190,214 |
Yes | output | 1 | 95,107 | 7 | 190,215 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He ... | instruction | 0 | 95,108 | 7 | 190,216 |
Yes | output | 1 | 95,108 | 7 | 190,217 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He ... | instruction | 0 | 95,109 | 7 | 190,218 |
Yes | output | 1 | 95,109 | 7 | 190,219 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He ... | instruction | 0 | 95,110 | 7 | 190,220 |
Yes | output | 1 | 95,110 | 7 | 190,221 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He ... | instruction | 0 | 95,111 | 7 | 190,222 |
No | output | 1 | 95,111 | 7 | 190,223 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He ... | instruction | 0 | 95,112 | 7 | 190,224 |
No | output | 1 | 95,112 | 7 | 190,225 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He ... | instruction | 0 | 95,113 | 7 | 190,226 |
No | output | 1 | 95,113 | 7 | 190,227 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Takahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He ... | instruction | 0 | 95,114 | 7 | 190,228 |
No | output | 1 | 95,114 | 7 | 190,229 |
Provide a correct Python 3 solution for this coding contest problem.
Artist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, Green, and Cyan, and each side is filled with one color. ... | instruction | 0 | 95,195 | 7 | 190,390 |
"Correct Solution:
```
roll = [
(0,1,2,3,4,5),
(1,5,2,3,0,4),
(2,1,5,0,4,3),
(3,1,0,5,4,2),
(4,0,2,3,5,1),
(5,4,2,3,1,0)]
def zero_move_to_left(xi):
r = roll[xi.index(0)]
return [xi[ri] for ri in r]
def sort_middle_face(xi):
m = xi[1:-1]
min_m = min(m)
while m[0] != min_m:
m = [m[1],m[3],... | output | 1 | 95,195 | 7 | 190,391 |
Provide a correct Python 3 solution for this coding contest problem.
Artist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, Green, and Cyan, and each side is filled with one color. ... | instruction | 0 | 95,196 | 7 | 190,392 |
"Correct Solution:
```
# AOJ 0198 Trouble in Shinagawa's Artifacts
# Python3 2018.6.20 bal4u
r = [ \
[0,1,2,3,4,5,6], [0,1,3,5,2,4,6], [0,1,4,2,5,3,6], [0,1,5,4,3,2,6], \
[0,2,6,3,4,1,5], [0,2,3,1,6,4,5], [0,2,1,4,3,6,5], [0,2,4,6,1,3,5], \
[0,3,1,2,5,6,4], [0,3,2,6,1,5,4], [0,3,5,1,6,2,4], [0,3,6,5,2,1,4], \
[0,4... | output | 1 | 95,196 | 7 | 190,393 |
Provide a correct Python 3 solution for this coding contest problem.
Artist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, Green, and Cyan, and each side is filled with one color. ... | instruction | 0 | 95,197 | 7 | 190,394 |
"Correct Solution:
```
import copy
class Dice:
def __init__(self, a, b, c, d, e, f):
self.top = a
self.front = b
self.right = c
self.left = d
self.behind = e
self.bottom = f
def S(self):
self.top, self.front, self.behind, self.bottom = self.behind, self... | output | 1 | 95,197 | 7 | 190,395 |
Provide a correct Python 3 solution for this coding contest problem.
Artist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, Green, and Cyan, and each side is filled with one color. ... | instruction | 0 | 95,198 | 7 | 190,396 |
"Correct Solution:
```
D = [
(1, 5, 2, 3, 0, 4), # 'U'
(3, 1, 0, 5, 4, 2), # 'R'
(4, 0, 2, 3, 5, 1), # 'D'
(2, 1, 5, 0, 4, 3), # 'L'
]
p_dice = (0, 0, 0, 1, 1, 2, 2, 3)*3
def rotate_dice(L0):
L = L0[:]
for k in p_dice:
yield L
L[:] = (L[e] for e in D[k])
while 1:
N = int(in... | output | 1 | 95,198 | 7 | 190,397 |
Provide a correct Python 3 solution for this coding contest problem.
Artist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, Green, and Cyan, and each side is filled with one color. ... | instruction | 0 | 95,199 | 7 | 190,398 |
"Correct Solution:
```
class Dice:
same_dice_index = ((0, 1, 2, 3, 4, 5), (0, 2, 4, 1, 3, 5), (0, 3, 1, 4, 2, 5),
(0, 4, 3, 2, 1, 5), (1, 0, 3, 2, 5, 4), (1, 2, 0, 5, 3, 4),
(1, 3, 5, 0, 2, 4), (1, 5, 2, 3, 0, 4), (2, 0, 1, 4, 5, 3),
(2, 1, 5, 0, ... | output | 1 | 95,199 | 7 | 190,399 |
Provide a correct Python 3 solution for this coding contest problem.
Artist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, Green, and Cyan, and each side is filled with one color. ... | instruction | 0 | 95,200 | 7 | 190,400 |
"Correct Solution:
```
def to_top_red(cube):
c1, c2, c3, c4, c5, c6 = cube
if c2 == "Red":
c1, c2, c6, c5 = c2, c6, c5, c1
elif c3 == "Red":
c1, c4, c6, c3 = c3, c1, c4, c6
elif c4 == "Red":
c1, c4, c6, c3 = c4, c6, c3, c1
elif c5 == "Red":
c1, c5, c6, c2 = c5, c6, c2, c1
elif c6 == "Red":
... | output | 1 | 95,200 | 7 | 190,401 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Artist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, G... | instruction | 0 | 95,201 | 7 | 190,402 |
No | output | 1 | 95,201 | 7 | 190,403 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Artist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, G... | instruction | 0 | 95,202 | 7 | 190,404 |
No | output | 1 | 95,202 | 7 | 190,405 |
Provide a correct Python 3 solution for this coding contest problem.
Training is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to practice today as well.
Today's training is to increase creativity by drawing pictures. Let's draw a pattern well using a square stamp.
I wa... | instruction | 0 | 95,234 | 7 | 190,468 |
"Correct Solution:
```
def solve():
from sys import stdin
from itertools import combinations
file_input = stdin
N = int(file_input.readline())
hw = [tuple(map(int, file_input.readline().split())) for i in range(N)]
goal = (line.rstrip() for line in file_input)
goal = ''.join(goal)
... | output | 1 | 95,234 | 7 | 190,469 |
Provide a correct Python 3 solution for this coding contest problem.
Training is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to practice today as well.
Today's training is to increase creativity by drawing pictures. Let's draw a pattern well using a square stamp.
I wa... | instruction | 0 | 95,235 | 7 | 190,470 |
"Correct Solution:
```
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int... | output | 1 | 95,235 | 7 | 190,471 |
Provide a correct Python 3 solution for this coding contest problem.
In the Jambo Amusement Garden (JAG), you sell colorful drinks consisting of multiple color layers. This colorful drink can be made by pouring multiple colored liquids of different density from the bottom in order.
You have already prepared several c... | instruction | 0 | 95,241 | 7 | 190,482 |
"Correct Solution:
```
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.st... | output | 1 | 95,241 | 7 | 190,483 |
Provide a correct Python 3 solution for this coding contest problem.
In the Jambo Amusement Garden (JAG), you sell colorful drinks consisting of multiple color layers. This colorful drink can be made by pouring multiple colored liquids of different density from the bottom in order.
You have already prepared several c... | instruction | 0 | 95,242 | 7 | 190,484 |
"Correct Solution:
```
import sys
liquids={}
O=[]
N = int(input())
for i in range(N):
C,D=(input().split())
if C in liquids.keys():
liquids[C].append(int(D))
else:
liquids[C]=[]
liquids[C].append(int(D))
for i in liquids.keys():
liquids[i]=list(set(liquids[i]))
liquids[i].so... | output | 1 | 95,242 | 7 | 190,485 |
Provide a correct Python 3 solution for this coding contest problem.
In the Jambo Amusement Garden (JAG), you sell colorful drinks consisting of multiple color layers. This colorful drink can be made by pouring multiple colored liquids of different density from the bottom in order.
You have already prepared several c... | instruction | 0 | 95,243 | 7 | 190,486 |
"Correct Solution:
```
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def L... | output | 1 | 95,243 | 7 | 190,487 |
Provide tags and a correct Python 3 solution for this coding contest problem.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.
Construction set "Electrician-n" consists of ... | instruction | 0 | 95,367 | 7 | 190,734 |
Tags: constructive algorithms, graphs, math, sortings, trees
Correct Solution:
```
n = int(input())
dists = list(map(int, input().split()))
dists = list(enumerate(dists))
# Sort from large to small
dists.sort(key=lambda x: -x[1])
dist = [[2*idx + 1] for idx, _ in dists]
for cur_idx, (idx, w) in enumerate(dists):
... | output | 1 | 95,367 | 7 | 190,735 |
Provide tags and a correct Python 3 solution for this coding contest problem.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.
Construction set "Electrician-n" consists of ... | instruction | 0 | 95,368 | 7 | 190,736 |
Tags: constructive algorithms, graphs, math, sortings, trees
Correct Solution:
```
# https://codeforces.com/contest/1214/problem/E
n = int(input())
d = map(int, input().split())
d = [[2*i+1, di] for i, di in enumerate(d)]
d = sorted(d, key=lambda x:x[1], reverse = True)
edge = []
arr = [x[0] for x in d]
for i, [x, ... | output | 1 | 95,368 | 7 | 190,737 |
Provide tags and a correct Python 3 solution for this coding contest problem.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.
Construction set "Electrician-n" consists of ... | instruction | 0 | 95,369 | 7 | 190,738 |
Tags: constructive algorithms, graphs, math, sortings, trees
Correct Solution:
```
import sys
input=sys.stdin.buffer.readline
n=int(input())
a=list(map(int,input().split()))
stored=[[10000000000,0]]
gaped=[0]
for i in range(n):
stored.append([a[i],2*i+1])
stored.sort(reverse=True)
for i in range(1,n):
gaped.app... | output | 1 | 95,369 | 7 | 190,739 |
Provide tags and a correct Python 3 solution for this coding contest problem.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.
Construction set "Electrician-n" consists of ... | instruction | 0 | 95,370 | 7 | 190,740 |
Tags: constructive algorithms, graphs, math, sortings, trees
Correct Solution:
```
import sys
input = sys.stdin.readline
n=int(input())
d=[int(i) for i in input().split(' ')]
v=[2*i+1 for i in range(n)]
v.sort(key = lambda x:d[x//2],reverse = 1)
for i in range(n-1):print(v[i],v[i+1])
currlen = len(v) #len of v
f... | output | 1 | 95,370 | 7 | 190,741 |
Provide tags and a correct Python 3 solution for this coding contest problem.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.
Construction set "Electrician-n" consists of ... | instruction | 0 | 95,371 | 7 | 190,742 |
Tags: constructive algorithms, graphs, math, sortings, trees
Correct Solution:
```
import sys
input = sys.stdin.readline
n=int(input())
d=list(map(int,input().split()))
ANS=[]
def pri(x,y):
sys.stdout.write(str(x)+" "+str(y)+"\n")
D=[(x,i) for i,x in enumerate(d)]
D.sort(reverse=True)
CHAIN=[y*2+1 for _,y ... | output | 1 | 95,371 | 7 | 190,743 |
Provide tags and a correct Python 3 solution for this coding contest problem.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.
Construction set "Electrician-n" consists of ... | instruction | 0 | 95,372 | 7 | 190,744 |
Tags: constructive algorithms, graphs, math, sortings, trees
Correct Solution:
```
import sys
input = sys.stdin.readline
def main():
n = int(input())
d = list(map(int, input().split()))
d = list(enumerate(d))
d.sort(key = lambda x: x[1], reverse = True)
edges = []
def add_edge(a, b):
... | output | 1 | 95,372 | 7 | 190,745 |
Provide tags and a correct Python 3 solution for this coding contest problem.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.
Construction set "Electrician-n" consists of ... | instruction | 0 | 95,373 | 7 | 190,746 |
Tags: constructive algorithms, graphs, math, sortings, trees
Correct Solution:
```
n = int(input())
d = [int(item) for item in input().split()]
ds = []
ans = []
for i, item in enumerate(d):
ds.append((item, i))
ds.sort(reverse=True)
max_dist = ds[0][0]
max_idx = ds[0][1]
to_fill = max_dist - 1
ans = [[] for _ in ... | output | 1 | 95,373 | 7 | 190,747 |
Provide tags and a correct Python 3 solution for this coding contest problem.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.
Construction set "Electrician-n" consists of ... | instruction | 0 | 95,374 | 7 | 190,748 |
Tags: constructive algorithms, graphs, math, sortings, trees
Correct Solution:
```
n = int(input())
v = list(map(int, input().split()))
v = sorted([(v[i], i * 2 + 1) for i in range(n)], reverse=True)
print('\n'.join([str(v[i][1]) + ' ' + str(v[i + 1][1]) for i in range(n - 1)]))
r = [i[1] for i in v]
for i in range(n):... | output | 1 | 95,374 | 7 | 190,749 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.... | instruction | 0 | 95,375 | 7 | 190,750 |
Yes | output | 1 | 95,375 | 7 | 190,751 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.... | instruction | 0 | 95,376 | 7 | 190,752 |
Yes | output | 1 | 95,376 | 7 | 190,753 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.... | instruction | 0 | 95,377 | 7 | 190,754 |
Yes | output | 1 | 95,377 | 7 | 190,755 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.... | instruction | 0 | 95,378 | 7 | 190,756 |
Yes | output | 1 | 95,378 | 7 | 190,757 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.... | instruction | 0 | 95,379 | 7 | 190,758 |
No | output | 1 | 95,379 | 7 | 190,759 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It's Petya's birthday party and his friends have presented him a brand new "Electrician-n" construction set, which they are sure he will enjoy as he always does with weird puzzles they give him.... | instruction | 0 | 95,380 | 7 | 190,760 |
No | output | 1 | 95,380 | 7 | 190,761 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.