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 |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Silver Fox is fighting with N monsters.
The monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the hea... | instruction | 0 | 67,918 | 2 | 135,836 |
Yes | output | 1 | 67,918 | 2 | 135,837 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Silver Fox is fighting with N monsters.
The monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the hea... | instruction | 0 | 67,919 | 2 | 135,838 |
Yes | output | 1 | 67,919 | 2 | 135,839 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Silver Fox is fighting with N monsters.
The monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the hea... | instruction | 0 | 67,920 | 2 | 135,840 |
Yes | output | 1 | 67,920 | 2 | 135,841 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Silver Fox is fighting with N monsters.
The monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the hea... | instruction | 0 | 67,921 | 2 | 135,842 |
Yes | output | 1 | 67,921 | 2 | 135,843 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Silver Fox is fighting with N monsters.
The monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the hea... | instruction | 0 | 67,922 | 2 | 135,844 |
No | output | 1 | 67,922 | 2 | 135,845 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Silver Fox is fighting with N monsters.
The monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the hea... | instruction | 0 | 67,923 | 2 | 135,846 |
No | output | 1 | 67,923 | 2 | 135,847 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Silver Fox is fighting with N monsters.
The monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the hea... | instruction | 0 | 67,924 | 2 | 135,848 |
No | output | 1 | 67,924 | 2 | 135,849 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Silver Fox is fighting with N monsters.
The monsters are standing in a row, and we can assume them to be standing on a number line. The i-th monster, standing at the coordinate X_i, has the hea... | instruction | 0 | 67,925 | 2 | 135,850 |
No | output | 1 | 67,925 | 2 | 135,851 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
While roaming the mystic areas of Stonefalls, in order to drop legendary loot, an adventurer was given a quest as follows. He was given an array A = {a_1,a_2,...,a_N } of length N, and a number ... | instruction | 0 | 68,241 | 2 | 136,482 |
No | output | 1 | 68,241 | 2 | 136,483 |
Provide tags and a correct Python 3 solution for this coding contest problem.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am... | instruction | 0 | 68,595 | 2 | 137,190 |
Tags: constructive algorithms, sortings
Correct Solution:
```
n = int(input())
arr = list(map(int, input().split()))
maximum = arr[0]
minimum = arr[0]
for value in arr:
if maximum < value:
maximum = value
if minimum > value:
minimum = value
print(len([value for value in arr if value != minimum... | output | 1 | 68,595 | 2 | 137,191 |
Provide tags and a correct Python 3 solution for this coding contest problem.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am... | instruction | 0 | 68,596 | 2 | 137,192 |
Tags: constructive algorithms, sortings
Correct Solution:
```
t=int(input())
a=list(map(int,input().strip().split(" ")))
a.sort()
c=1;d=1
if t==1:
print(0)
else:
for i in range(t-1):
if a[i]==a[i+1]:
c+=1
else:
break
for i in range(t-1,0,-1):
if a[i]==a[... | output | 1 | 68,596 | 2 | 137,193 |
Provide tags and a correct Python 3 solution for this coding contest problem.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am... | instruction | 0 | 68,597 | 2 | 137,194 |
Tags: constructive algorithms, sortings
Correct Solution:
```
n = int(input())
stuards = [int(x) for x in input().split()]
ans = 0
mn, mx = min(stuards), max(stuards)
for i in stuards:
if i == mn or i == mx:
continue
else:
ans += 1
print(ans)
``` | output | 1 | 68,597 | 2 | 137,195 |
Provide tags and a correct Python 3 solution for this coding contest problem.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am... | instruction | 0 | 68,598 | 2 | 137,196 |
Tags: constructive algorithms, sortings
Correct Solution:
```
n = int(input())
v = [int(x) for x in input().split()]
mn = min(v)
mm = max(v)
ans = 0
for i in range(len(v)):
if v[i] > mn and v[i] < mm:
ans += 1
print(ans)
``` | output | 1 | 68,598 | 2 | 137,197 |
Provide tags and a correct Python 3 solution for this coding contest problem.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am... | instruction | 0 | 68,599 | 2 | 137,198 |
Tags: constructive algorithms, sortings
Correct Solution:
```
number = int(input())
strenght = list(map(int, input().split()))
strenght.sort()
if strenght[0] != strenght[-1]:
borders = strenght.count(strenght[0]) + strenght.count(strenght[-1])
else:
borders = strenght.count(strenght[0])
print(number-borders)
`... | output | 1 | 68,599 | 2 | 137,199 |
Provide tags and a correct Python 3 solution for this coding contest problem.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am... | instruction | 0 | 68,600 | 2 | 137,200 |
Tags: constructive algorithms, sortings
Correct Solution:
```
n = int(input())
l = [int(x) for x in input().split()]
if len(l) <= 2:
print(0)
else:
mx, mn = max(l), min(l)
if mx == mn:
print(0)
else:
cnt_feed = l.count(mx)+l.count(mn)
print(n-cnt_feed)
``` | output | 1 | 68,600 | 2 | 137,201 |
Provide tags and a correct Python 3 solution for this coding contest problem.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am... | instruction | 0 | 68,601 | 2 | 137,202 |
Tags: constructive algorithms, sortings
Correct Solution:
```
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = [a[0]] + [a[-1]]
for i in range(1,n):
if a[i] in b: b.append(a[i])
else: break
for i in range(n-2,-1,-1):
if a[i] in b: b.append(a[i])
else: break
print(max(len(a)-len(b),0))
``... | output | 1 | 68,601 | 2 | 137,203 |
Provide tags and a correct Python 3 solution for this coding contest problem.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die at my post. I am the sword in the darkness. I am... | instruction | 0 | 68,602 | 2 | 137,204 |
Tags: constructive algorithms, sortings
Correct Solution:
```
n = int(input())
t = [int(i) for i in input().split()]
s, mn, mx = 0, min(t), max(t)
for x in t:
if mn < x < mx:
s += 1
print(s)
``` | output | 1 | 68,602 | 2 | 137,205 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die a... | instruction | 0 | 68,603 | 2 | 137,206 |
Yes | output | 1 | 68,603 | 2 | 137,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die a... | instruction | 0 | 68,604 | 2 | 137,208 |
Yes | output | 1 | 68,604 | 2 | 137,209 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die a... | instruction | 0 | 68,605 | 2 | 137,210 |
Yes | output | 1 | 68,605 | 2 | 137,211 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die a... | instruction | 0 | 68,606 | 2 | 137,212 |
Yes | output | 1 | 68,606 | 2 | 137,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die a... | instruction | 0 | 68,607 | 2 | 137,214 |
No | output | 1 | 68,607 | 2 | 137,215 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die a... | instruction | 0 | 68,608 | 2 | 137,216 |
No | output | 1 | 68,608 | 2 | 137,217 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die a... | instruction | 0 | 68,609 | 2 | 137,218 |
No | output | 1 | 68,609 | 2 | 137,219 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
"Night gathers, and now my watch begins. It shall not end until my death. I shall take no wife, hold no lands, father no children. I shall wear no crowns and win no glory. I shall live and die a... | instruction | 0 | 68,610 | 2 | 137,220 |
No | output | 1 | 68,610 | 2 | 137,221 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n knights sitting at the Round Table at an equal distance from each other. Each of them is either in a good or in a bad mood.
Merlin, the wizard predicted to King Arthur that the next month will turn out to be particularly fortuna... | instruction | 0 | 69,461 | 2 | 138,922 |
Tags: dp, math, number theory
Correct Solution:
```
def divisors(n):
i = 2
res = set()
tmp = n
while i * i <= n:
while tmp % i == 0:
tmp //= i
res.add(i)
i += 1
if tmp != 1:
res.add(tmp)
if n % 4 == 0:
res.add(4)
res.discard(2)
... | output | 1 | 69,461 | 2 | 138,923 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n knights sitting at the Round Table at an equal distance from each other. Each of them is either in a good or in a bad mood.
Merlin, the wizard predicted to King Arthur that the next month will turn out to be particularly fortuna... | instruction | 0 | 69,462 | 2 | 138,924 |
Tags: dp, math, number theory
Correct Solution:
```
def gen_prime(n):
prime = []
prime.append(2)
prime.append(3)
prime.append(4)
for i in range(5, n+1):
div = False
for j in prime:
if not i%j:
div = True
break
if not div:
prime.append(i)
return prime
n = int(input())
prime = gen_prime(n)
p... | output | 1 | 69,462 | 2 | 138,925 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n knights sitting at the Round Table at an equal distance from each other. Each of them is either in a good or in a bad mood.
Merlin, the wizard predicted to King Arthur that the next month will turn out to be particularly fortuna... | instruction | 0 | 69,463 | 2 | 138,926 |
Tags: dp, math, number theory
Correct Solution:
```
n=int(input())
b=list(map(int,input().split()))
p=int(n**0.5)+1
j=1
r=n
c=[]
while(j<p):
if n%j==0:
k=j
r=n//j
if k>=3:
c.append(k)
if r>=3 and r!=k:
c.append(r)
j+=1
c=sorted(c)
f=0
for r in c:
k = ... | output | 1 | 69,463 | 2 | 138,927 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th wave consists of a_i monsters and happens from t... | instruction | 0 | 70,046 | 2 | 140,092 |
Tags: dp, greedy
Correct Solution:
```
n, k = list(map(int, input().split()))
L = []
R = []
A = []
for i in range (0, n):
x = list(map(int, input().split()))
L.append(x[0])
R.append(x[1])
A.append(x[2])
L.append(R[-1])
i = n-1
x = 0
y = 0
ans = 0
v = True
N = [0 for i in range (0, n)]
while i >= 0:
... | output | 1 | 70,046 | 2 | 140,093 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th wave consists of a_i monsters and happens from t... | instruction | 0 | 70,047 | 2 | 140,094 |
Tags: dp, greedy
Correct Solution:
```
#!/usr/bin/env python3
# from typing import *
import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq
def input():
return sys.stdin.readline()[:-1]
# sys.setrecursionlimit(1000000)
# _INPUT = """10 89
# 1 2 82
# 2 2 ... | output | 1 | 70,047 | 2 | 140,095 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th wave consists of a_i monsters and happens from t... | instruction | 0 | 70,048 | 2 | 140,096 |
Tags: dp, greedy
Correct Solution:
```
import sys
n, k = map(int, input().split())
L, R, A = [0] * n, [0] * n, [0] * n
for i in range(n):
L[i], R[i], A[i] = map(int, input().split())
dp = [0] * (n + 1)
for i in range(n - 1, -1, -1):
need = A[i]
if i < n - 1 and R[i] == L[i + 1]:
need += dp[i + 1]
... | output | 1 | 70,048 | 2 | 140,097 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th wave consists of a_i monsters and happens from t... | instruction | 0 | 70,049 | 2 | 140,098 |
Tags: dp, greedy
Correct Solution:
```
from bisect import *
from collections import *
from math import *
from heapq import *
from typing import List
from itertools import *
from operator import *
from functools import *
#------------------------------------------------------------------------
import os
import sys
from... | output | 1 | 70,049 | 2 | 140,099 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th wave consists of a_i monsters and happens from t... | instruction | 0 | 70,050 | 2 | 140,100 |
Tags: dp, greedy
Correct Solution:
```
import sys
input = sys.stdin.buffer.readline
n,k = map(int,input().split())
tank = [(k,0)]
new = []
L = [0]*n
R = [0]*n
A = [0]*n
for i in range(n):
L[i],R[i],A[i] = map(int,input().split())
for i in range(n):
new = []
l,r,a = L[i],R[i],A[i]
val = -1
for ... | output | 1 | 70,050 | 2 | 140,101 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th wave consists of a_i monsters and happens from t... | instruction | 0 | 70,051 | 2 | 140,102 |
Tags: dp, greedy
Correct Solution:
```
import sys
from array import array # noqa: F401
import typing as Tp # noqa: F401
def input():
return sys.stdin.buffer.readline().decode('utf-8')
def output(*args):
sys.stdout.buffer.write(
('\n'.join(map(str, args)) + '\n').encode('utf-8')
)
def main():... | output | 1 | 70,051 | 2 | 140,103 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th wave consists of a_i monsters and happens from t... | instruction | 0 | 70,052 | 2 | 140,104 |
Tags: dp, greedy
Correct Solution:
```
#!/usr/bin/env python
from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from types import ModuleType
class _TailCall(Exception):
def __init__(self, f, args, uid):
self.func, self.args, self.uid, self.follow = f.func, a... | output | 1 | 70,052 | 2 | 140,105 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th wave consists of a_i monsters and happens from t... | instruction | 0 | 70,053 | 2 | 140,106 |
Tags: dp, greedy
Correct Solution:
```
import sys
n, k = map(int, input().split())
L, R, A = [0] * n, [0] * n, [0] * n
for i in range(n):
L[i], R[i], A[i] = map(int, input().split())
dp = [0] * (n + 1)
for i in range(n - 1, -1, -1):
need = A[i]
if i < n - 1 and R[i] == L[i + 1]:
need += dp[i + 1]
... | output | 1 | 70,053 | 2 | 140,107 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th w... | instruction | 0 | 70,054 | 2 | 140,108 |
Yes | output | 1 | 70,054 | 2 | 140,109 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th w... | instruction | 0 | 70,055 | 2 | 140,110 |
No | output | 1 | 70,055 | 2 | 140,111 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th w... | instruction | 0 | 70,056 | 2 | 140,112 |
No | output | 1 | 70,056 | 2 | 140,113 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th w... | instruction | 0 | 70,057 | 2 | 140,114 |
No | output | 1 | 70,057 | 2 | 140,115 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Recently you've discovered a new shooter. They say it has realistic game mechanics.
Your character has a gun with magazine size equal to k and should exterminate n waves of monsters. The i-th w... | instruction | 0 | 70,058 | 2 | 140,116 |
No | output | 1 | 70,058 | 2 | 140,117 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Harry Potter has a difficult homework. Given a rectangular table, consisting of n × m cells. Each cell of the table contains the integer. Harry knows how to use two spells: the first spell change the sign of the integers in the selected row,... | instruction | 0 | 70,113 | 2 | 140,226 |
Tags: constructive algorithms, greedy
Correct Solution:
```
import math
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
a = [[] for _ in range(n)]
for i in range(n):
a[i] = [int(_) for _ in input().split()]
row = []
col = []
rowStat = [1] * n
colStat = [1] * m
while True:
bad = False
... | output | 1 | 70,113 | 2 | 140,227 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Harry Potter has a difficult homework. Given a rectangular table, consisting of n × m cells. Each cell of the table contains the integer. Harry knows how to use two spells: the first spell chang... | instruction | 0 | 70,114 | 2 | 140,228 |
No | output | 1 | 70,114 | 2 | 140,229 |
Provide tags and a correct Python 2 solution for this coding contest problem.
Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon Snow has his favourite number x. Each ranger can fight with a white walker only if the strength of the white walker equals his stren... | instruction | 0 | 70,360 | 2 | 140,720 |
Tags: brute force, dp, implementation, sortings
Correct Solution:
```
from sys import stdin, stdout
from collections import Counter, defaultdict
from itertools import permutations, combinations
raw_input = stdin.readline
pr = stdout.write
def in_num():
return int(raw_input())
def in_arr():
return map(int,ra... | output | 1 | 70,360 | 2 | 140,721 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon Snow has his favourite number x. Each ranger can fight with a white walker only if the strength of the white walker equals his stren... | instruction | 0 | 70,361 | 2 | 140,722 |
Tags: brute force, dp, implementation, sortings
Correct Solution:
```
n, k, x = map(int, input().split())
arr = list(map(int, input().split()))
dp = [[0 for i in range(1024)], [0 for i in range(1024)]]
for i in range(n):
dp[0][arr[i]] += 1
for i in range(k):
for j in range(1024):
dp[~i&1][j] = 0
ct... | output | 1 | 70,361 | 2 | 140,723 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon Snow has his favourite number x. Each ranger can fight with a white walker only if the strength of the white walker equals his stren... | instruction | 0 | 70,362 | 2 | 140,724 |
Tags: brute force, dp, implementation, sortings
Correct Solution:
```
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 25 02:16:02 2020
@author: Dark Soul
"""
[n,k,x]=list(map(int, input().split()))
arr=list(map(int, input().split()))
if k%2:
y=1
else:
y=2
if n*k<1000000:
y=k
if k==0:
print(max(arr),min... | output | 1 | 70,362 | 2 | 140,725 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon Snow has his favourite number x. Each ranger can fight with a white walker only if the strength of the white walker equals his stren... | instruction | 0 | 70,363 | 2 | 140,726 |
Tags: brute force, dp, implementation, sortings
Correct Solution:
```
n,k,x=map(int,input().split())
r=list(map(int,input().split()))
k%=64
while k:
k-=1
r.sort()
for i in range(0,n,2):#alternate
r[i]^=x
print(max(r),min(r))
``` | output | 1 | 70,363 | 2 | 140,727 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon Snow has his favourite number x. Each ranger can fight with a white walker only if the strength of the white walker equals his stren... | instruction | 0 | 70,364 | 2 | 140,728 |
Tags: brute force, dp, implementation, sortings
Correct Solution:
```
N, K, X = map( int, input().split() )
A = list( map( int, input().split() ) )
freq = [ [ 0 for i in range( 1024 ) ], [ 0 for i in range( 1024 ) ] ]
for i in range( N ):
freq[ 0 ][ A[ i ] ] += 1
for i in range( K ):
for j in range( 1024 ):
f... | output | 1 | 70,364 | 2 | 140,729 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon Snow has his favourite number x. Each ranger can fight with a white walker only if the strength of the white walker equals his stren... | instruction | 0 | 70,365 | 2 | 140,730 |
Tags: brute force, dp, implementation, sortings
Correct Solution:
```
from itertools import accumulate
R = lambda: map(int, input().split())
n, k, num = R()
cnts = [0] * 1025
for x in R():
cnts[x] += 1
for _ in range(k):
nxt_cnts = [0] * 1025
acc = list(accumulate(cnts)) + [0]
for i in range(1025):
... | output | 1 | 70,365 | 2 | 140,731 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Jon Snow now has to fight with White Walkers. He has n rangers, each of which has his own strength. Also Jon Snow has his favourite number x. Each ranger can fight with a white walker only if the strength of the white walker equals his stren... | instruction | 0 | 70,366 | 2 | 140,732 |
Tags: brute force, dp, implementation, sortings
Correct Solution:
```
# Legends Always Come Up with Solution
# Author: Manvir Singh
import os
import sys
from io import BytesIO, IOBase
def main():
n, k, x = map(int, input().split())
a = list(map(int, input().split()))
ma = max(max(a),max(i^x for i in a))
... | output | 1 | 70,366 | 2 | 140,733 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.