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 a correct Python 3 solution for this coding contest problem.
Problem D: Legendary Sword
* This problem contains a lot of two ingredients in the kitchen. Please be careful about heartburn.
The Demon King, who has finally revived, is about to invade the human world to wrap the world in darkness again.
The Dem... | instruction | 0 | 5,769 | 2 | 11,538 |
"Correct Solution:
```
while True:
w, h = map(int, input().split())
if w == 0:break
mp = [input().split() for _ in range(h)]
points = {}
for y in range(h):
for x in range(w):
if mp[y][x] == "S":
sx, sy = x, y
points[0] = [(x, y)]
elif mp[y][x] == "G":
gx, gy = x, y
... | output | 1 | 5,769 | 2 | 11,539 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, and the... | instruction | 0 | 6,119 | 2 | 12,238 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n = int(input())
a = []
for i in range(n):
a.append(input())
if 'E' * n in a and ('E',) * n in zip(*a):
print(-1)
elif 'E' * n in a:
for j, s in enumerate(map(lambda x: ''.join(x), zip(*a))):
for i, c in enumerate(s):
if c == '.... | output | 1 | 6,119 | 2 | 12,239 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, and the... | instruction | 0 | 6,120 | 2 | 12,240 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n = int(input())
c = [list(input()) for _ in range(n)]
r = set()
s = set()
rows = set()
cols = set()
for i in range(n):
for j in range(n):
if c[i][j] == "." and (i not in rows):
r.add((i+1, j+1))
rows.add(i)
brea... | output | 1 | 6,120 | 2 | 12,241 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, and the... | instruction | 0 | 6,121 | 2 | 12,242 |
Tags: constructive algorithms, greedy
Correct Solution:
```
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from b... | output | 1 | 6,121 | 2 | 12,243 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, and the... | instruction | 0 | 6,122 | 2 | 12,244 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n = int(input())
a = []
for i in range(n):
a.append(input())
if 'E' * n in a and ('E',) * n in zip(*a):
print(-1)
elif 'E' * n in a:
for j, s in enumerate(map(lambda x: ''.join(x), zip(*a))):
for i, c in enumerate(s):
i... | output | 1 | 6,122 | 2 | 12,245 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, and the... | instruction | 0 | 6,123 | 2 | 12,246 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n = int(input())
maze = [input().strip() for _ in range(n)]
def go(by_row):
global maze
maze = list(zip(*maze))
can = True
for i in range(n):
if '.' not in maze[i]:
can = False
if can:
for i in range(n):
... | output | 1 | 6,123 | 2 | 12,247 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, and the... | instruction | 0 | 6,124 | 2 | 12,248 |
Tags: constructive algorithms, greedy
Correct Solution:
```
#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import*
from io import BytesIO, IOBase
def vsInput():
sys.stdin = open('i... | output | 1 | 6,124 | 2 | 12,249 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, and the... | instruction | 0 | 6,125 | 2 | 12,250 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n = int(input())
pl = [0] * 100
p = [[] for i in range(100)]
s = [str() for i in range(100)]
cp = [0] * 100
rp = [0] * 100
for i in range(n):
s[i] = str(input())
for j in range(len(s[i])):
if s[i][j] == '.':
rp[i] += 1
... | output | 1 | 6,125 | 2 | 12,251 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are numbered 1 through n from top to bottom, and the... | instruction | 0 | 6,126 | 2 | 12,252 |
Tags: constructive algorithms, greedy
Correct Solution:
```
n = int(input())
grid = [input() for line in range(n)]
total = sum([ln.count('.') for ln in grid])
rowsWSpcN = len([True for ln in grid if '.' in ln])
colsWSpcN = len([True for col in range(n) if '.' in [ln[col] for ln in grid]])
rowsWSpc = [ln.count('.') for ... | output | 1 | 6,126 | 2 | 12,253 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are n... | instruction | 0 | 6,127 | 2 | 12,254 |
Yes | output | 1 | 6,127 | 2 | 12,255 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are n... | instruction | 0 | 6,128 | 2 | 12,256 |
Yes | output | 1 | 6,128 | 2 | 12,257 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are n... | instruction | 0 | 6,129 | 2 | 12,258 |
Yes | output | 1 | 6,129 | 2 | 12,259 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are n... | instruction | 0 | 6,130 | 2 | 12,260 |
Yes | output | 1 | 6,130 | 2 | 12,261 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are n... | instruction | 0 | 6,131 | 2 | 12,262 |
No | output | 1 | 6,131 | 2 | 12,263 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are n... | instruction | 0 | 6,132 | 2 | 12,264 |
No | output | 1 | 6,132 | 2 | 12,265 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are n... | instruction | 0 | 6,133 | 2 | 12,266 |
No | output | 1 | 6,133 | 2 | 12,267 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are an adventurer currently journeying inside an evil temple. After defeating a couple of weak zombies, you arrived at a square room consisting of tiles forming an n × n grid. The rows are n... | instruction | 0 | 6,134 | 2 | 12,268 |
No | output | 1 | 6,134 | 2 | 12,269 |
Provide a correct Python 3 solution for this coding contest problem.
Problem Statement
"Everlasting -One-" is an award-winning online game launched this year. This game has rapidly become famous for its large number of characters you can play.
In this game, a character is characterized by attributes. There are $N$ a... | instruction | 0 | 6,536 | 2 | 13,072 |
"Correct Solution:
```
from collections import deque
MOD = 10**9 + 7
while 1:
N, M = map(int, input().split())
if N == M == 0:
break
G = [[] for i in range(N)]
for i in range(M):
a, b = map(int, input().split())
G[a-1].append(b-1)
G[b-1].append(a-1)
que = deque()
... | output | 1 | 6,536 | 2 | 13,073 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor (so large and narrow that it can be represente... | instruction | 0 | 6,663 | 2 | 13,326 |
Tags: greedy, sortings
Correct Solution:
```
import sys
lines = sys.stdin.readlines()
num_cases = int(lines[0])
for i in range(num_cases):
n,r = map(int, lines[2*i+1].split())
L = sorted(set([int(x) for x in list(lines[2*i+2].split())]))
thresh = 0
while L and (L.pop()-thresh*r > 0):
thresh += 1
print(thr... | output | 1 | 6,663 | 2 | 13,327 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor (so large and narrow that it can be represente... | instruction | 0 | 6,664 | 2 | 13,328 |
Tags: greedy, sortings
Correct Solution:
```
from sys import stdin,stdout
for _ in range(int(stdin.readline())):
n,r=map(int,stdin.readline().split())
l=list(map(int,stdin.readline().split()))
l=sorted(list(set(l)))
d=0
ans=0
n=len(l)
for i in range(n-1,-1,-1):
if l[i]<=d:
... | output | 1 | 6,664 | 2 | 13,329 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor (so large and narrow that it can be represente... | instruction | 0 | 6,665 | 2 | 13,330 |
Tags: greedy, sortings
Correct Solution:
```
from sys import stdin, stdout
a = int(stdin.readline())
result = ''
for _ in range(a):
n, r = map(int, stdin.readline().split())
monsters = set(int(m) for m in stdin.readline().split())
shots, acc = 0, 0
for m in sorted(monsters, reverse=True):
if ... | output | 1 | 6,665 | 2 | 13,331 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor (so large and narrow that it can be represente... | instruction | 0 | 6,666 | 2 | 13,332 |
Tags: greedy, sortings
Correct Solution:
```
#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
#from fractions import *
from bisect import *
from io import BytesIO, IOBase
def vsInput():
sys.stdin = open('input.txt', 'r')
sys.stdout = ... | output | 1 | 6,666 | 2 | 13,333 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor (so large and narrow that it can be represente... | instruction | 0 | 6,667 | 2 | 13,334 |
Tags: greedy, sortings
Correct Solution:
```
import math
q = int(input())
ans_str = ''
def solve(r, x):
a = 0
x = sorted(x)
p = [0]* len(x)
for i in range(len(x)):
p[i] = min(math.ceil(x[i]/r), len(x) - i)
return str(max(p))+ "\n"
for _ in range(q):
a = 0
n, r = map(int, input().spli... | output | 1 | 6,667 | 2 | 13,335 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor (so large and narrow that it can be represente... | instruction | 0 | 6,668 | 2 | 13,336 |
Tags: greedy, sortings
Correct Solution:
```
import sys
input = sys.stdin.buffer.readline
q=int(input())
s=''
for _ in range(q):
n,r=map(int,input().split())
l=set(map(int,input().split()))
l=list(l)
l=sorted(l)
count=0
while l and l[-1]>count*r:
l.pop()
count+=1
print(count... | output | 1 | 6,668 | 2 | 13,337 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor (so large and narrow that it can be represente... | instruction | 0 | 6,669 | 2 | 13,338 |
Tags: greedy, sortings
Correct Solution:
```
import sys
input=sys.stdin.readline
q=int(input())
for _ in range(q):
n,r=[int(w) for w in input().split()]
x=sorted({int(w) for w in input().split()})
n=len(x)
for i in range(n):
if x[i] > r*(n-i-1):
break
print(n-i)
``` | output | 1 | 6,669 | 2 | 13,339 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor (so large and narrow that it can be represente... | instruction | 0 | 6,670 | 2 | 13,340 |
Tags: greedy, sortings
Correct Solution:
```
def solve(n, r, pos):
ans = 0
pos = list(set(pos))
pos.sort(reverse=True)
to_left = 0
for i in pos:
if i - to_left <= 0:
break
to_left += r
ans += 1
return ans
def main():
q = int(input())
result = []
... | output | 1 | 6,670 | 2 | 13,341 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor... | instruction | 0 | 6,671 | 2 | 13,342 |
Yes | output | 1 | 6,671 | 2 | 13,343 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor... | instruction | 0 | 6,672 | 2 | 13,344 |
Yes | output | 1 | 6,672 | 2 | 13,345 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor... | instruction | 0 | 6,673 | 2 | 13,346 |
Yes | output | 1 | 6,673 | 2 | 13,347 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor... | instruction | 0 | 6,674 | 2 | 13,348 |
Yes | output | 1 | 6,674 | 2 | 13,349 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor... | instruction | 0 | 6,675 | 2 | 13,350 |
No | output | 1 | 6,675 | 2 | 13,351 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor... | instruction | 0 | 6,676 | 2 | 13,352 |
No | output | 1 | 6,676 | 2 | 13,353 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor... | instruction | 0 | 6,677 | 2 | 13,354 |
No | output | 1 | 6,677 | 2 | 13,355 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ivan plays an old action game called Heretic. He's stuck on one of the final levels of this game, so he needs some help with killing the monsters.
The main part of the level is a large corridor... | instruction | 0 | 6,678 | 2 | 13,356 |
No | output | 1 | 6,678 | 2 | 13,357 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, ....
<... | instruction | 0 | 7,174 | 2 | 14,348 |
Tags: brute force, math, number theory
Correct Solution:
```
# -*- coding: utf-8 -*-
a, b = map(int, input().split(' '))
c, d = map(int, input().split(' '))
if d < b:
x = b
b = d
d = x
x = a
a = c
c = x
k = 1
r = -1
while k < 100000:
n = (d-b+c*(k-1))/a+1
if n == int(n):
n = int(... | output | 1 | 7,174 | 2 | 14,349 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, ....
<... | instruction | 0 | 7,175 | 2 | 14,350 |
Tags: brute force, math, number theory
Correct Solution:
```
a, b = map(int, input().split())
c, d = map(int, input().split())
for i in range(max(max(a, b), max(c, d)) + 1):
if a * i + b - d >= 0 and (a * i + b - d) % c == 0:
print(a * i + b)
exit()
print(-1)
``` | output | 1 | 7,175 | 2 | 14,351 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, ....
<... | instruction | 0 | 7,176 | 2 | 14,352 |
Tags: brute force, math, number theory
Correct Solution:
```
from math import gcd
def main():
a, b = map(int, input().split())
c, d = map(int, input().split())
n = a * c // gcd(a, c) + b + d
l = [*[0] * n, 2]
for i in range(b, n, a):
l[i] = 1
for i in range(d, n, c):
l[i] += 1
... | output | 1 | 7,176 | 2 | 14,353 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, ....
<... | instruction | 0 | 7,177 | 2 | 14,354 |
Tags: brute force, math, number theory
Correct Solution:
```
g=lambda x,y:g(y,x%y)if y else x
a,b=map(int,input().split())
c,d=map(int,input().split())
e=g(a,c)
if (b-d)% e:print(-1)
else:
while b!=d:
if b<d:b+=a
else:d+=c
print(b)
``` | output | 1 | 7,177 | 2 | 14,355 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, ....
<... | instruction | 0 | 7,178 | 2 | 14,356 |
Tags: brute force, math, number theory
Correct Solution:
```
a, b = map(int, input().split())
c, d = map(int, input().split())
ans = -1
for i in range(100000):
if b == d:
ans = b
break
elif b < d:
b += a
else:
d += c
print(ans)
``` | output | 1 | 7,178 | 2 | 14,357 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, ....
<... | instruction | 0 | 7,179 | 2 | 14,358 |
Tags: brute force, math, number theory
Correct Solution:
```
ab = list(map(int, input().split()))
a = ab[0]
b = ab[1]
cd = list(map(int, input().split()))
c = cd[0]
d = cd[1]
num_list = []
if b == d:
print(b)
elif a > c:
for i in range(max(c, d // a + 1)):
num_list.append(a * i + b)
for i in num_li... | output | 1 | 7,179 | 2 | 14,359 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, ....
<... | instruction | 0 | 7,180 | 2 | 14,360 |
Tags: brute force, math, number theory
Correct Solution:
```
a, b = map(int, input().split())
c, d = map(int, input().split())
if b == d:
print(b)
else:
s = set()
for i in range(0, 101):
s.add(b + a * i)
for i in range(0, 101):
temp = d + c * i
if temp in s:
print(temp)
exit(0)
print(-1)
``` | output | 1 | 7,180 | 2 | 14,361 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A monster is chasing after Rick and Morty on another planet. They're so frightened that sometimes they scream. More accurately, Rick screams at times b, b + a, b + 2a, b + 3a, ... and Morty screams at times d, d + c, d + 2c, d + 3c, ....
<... | instruction | 0 | 7,181 | 2 | 14,362 |
Tags: brute force, math, number theory
Correct Solution:
```
a, b = [int(i) for i in input().split()]
c, d = [int(i) for i in input().split()]
res = [0 for i in range(10000000)]
for i in range(10000):
res[int(b + a*i)] = 1
for i in range(10000):
if res[d + c*i] == 1:
print(d+c*i)
exit()
p... | output | 1 | 7,181 | 2 | 14,363 |
Provide a correct Python 3 solution for this coding contest problem.
Nantendo Co., Ltd. has released a game software called Packet Monster. This game was intended to catch, raise, and fight monsters, and was a very popular game all over the world.
This game had features not found in traditional games. There are two v... | instruction | 0 | 8,346 | 2 | 16,692 |
"Correct Solution:
```
# AOJ 1036: Monster Factory
# Python3 2018.7.6 bal4u
while True:
in1 = list(input())
if in1[0] == '-': break
in2 = list(input())
out = list(input())
k = in2.pop(0)
ans, f = '', True
while len(in1) or len(in2):
if len(out) and out[0] == k:
k = in1.pop(0)
del out[0]
else:
ans +... | output | 1 | 8,346 | 2 | 16,693 |
Provide a correct Python 3 solution for this coding contest problem.
Nantendo Co., Ltd. has released a game software called Packet Monster. This game was intended to catch, raise, and fight monsters, and was a very popular game all over the world.
This game had features not found in traditional games. There are two v... | instruction | 0 | 8,347 | 2 | 16,694 |
"Correct Solution:
```
while True:
s1 = list(input())
if s1 == ["-"]:
break
s2 = list(input())
s1.reverse()
s2.reverse()
under = list(input())
under.reverse()
right = []
center = s2.pop()
while s1 or s2:
if under and center == under[-1]:
center = s1.pop()
under.pop()
else:
... | output | 1 | 8,347 | 2 | 16,695 |
Provide tags and a correct Python 3 solution for this coding contest problem.
n heroes fight against each other in the Arena. Initially, the i-th hero has level a_i.
Each minute, a fight between two different heroes occurs. These heroes can be chosen arbitrarily (it's even possible that it is the same two heroes that... | instruction | 0 | 8,571 | 2 | 17,142 |
Tags: implementation, sortings
Correct Solution:
```
from pprint import pprint
import sys
input = sys.stdin.readline
def do():
n = int(input())
dat = list(map(int, input().split()))
mix = min(dat)
res = 0
for x in dat:
if x > mix:
res += 1
print(res)
q = int(input())
for _ i... | output | 1 | 8,571 | 2 | 17,143 |
Provide tags and a correct Python 3 solution for this coding contest problem.
n heroes fight against each other in the Arena. Initially, the i-th hero has level a_i.
Each minute, a fight between two different heroes occurs. These heroes can be chosen arbitrarily (it's even possible that it is the same two heroes that... | instruction | 0 | 8,572 | 2 | 17,144 |
Tags: implementation, sortings
Correct Solution:
```
try:
t=int(input())
for i in range(t):
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)
pos=-1
for i in range(1,len(a)):
if a[i]!=a[i-1]:
pos=i
break
if pos... | output | 1 | 8,572 | 2 | 17,145 |
Provide tags and a correct Python 3 solution for this coding contest problem.
n heroes fight against each other in the Arena. Initially, the i-th hero has level a_i.
Each minute, a fight between two different heroes occurs. These heroes can be chosen arbitrarily (it's even possible that it is the same two heroes that... | instruction | 0 | 8,573 | 2 | 17,146 |
Tags: implementation, sortings
Correct Solution:
```
# Problem: A. Arena
# Contest: Codeforces - Educational Codeforces Round 104 (Rated for Div. 2)
# URL: https://codeforces.com/contest/1487/problem/A
# Memory Limit: 256 MB
# Time Limit: 1000 ms
#
# KAPOOR'S
from sys import stdin, stdout
def INI():
return int(std... | output | 1 | 8,573 | 2 | 17,147 |
Provide tags and a correct Python 3 solution for this coding contest problem.
n heroes fight against each other in the Arena. Initially, the i-th hero has level a_i.
Each minute, a fight between two different heroes occurs. These heroes can be chosen arbitrarily (it's even possible that it is the same two heroes that... | instruction | 0 | 8,574 | 2 | 17,148 |
Tags: implementation, sortings
Correct Solution:
```
#!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase
def func(heros):
return len(heros) - sum([1 for hero in heros if hero == min(heros)])
def main():
num_test = int(parse_input())
for _ in range(num_test):
num_hero = int(... | output | 1 | 8,574 | 2 | 17,149 |
Provide tags and a correct Python 3 solution for this coding contest problem.
n heroes fight against each other in the Arena. Initially, the i-th hero has level a_i.
Each minute, a fight between two different heroes occurs. These heroes can be chosen arbitrarily (it's even possible that it is the same two heroes that... | instruction | 0 | 8,575 | 2 | 17,150 |
Tags: implementation, sortings
Correct Solution:
```
"""
Author - Satwik Tiwari .
7th Feb , 2021 - Sunday
"""
#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function
from fractions impor... | output | 1 | 8,575 | 2 | 17,151 |
Provide tags and a correct Python 3 solution for this coding contest problem.
n heroes fight against each other in the Arena. Initially, the i-th hero has level a_i.
Each minute, a fight between two different heroes occurs. These heroes can be chosen arbitrarily (it's even possible that it is the same two heroes that... | instruction | 0 | 8,576 | 2 | 17,152 |
Tags: implementation, sortings
Correct Solution:
```
tests = int(input())
for t in range(tests):
n = int(input())
heroes = list(map(int, input().split(' ')))
m = min(heroes)
print(sum([1 for x in heroes if x > m]))
``` | output | 1 | 8,576 | 2 | 17,153 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.