prompt large_stringlengths 340 8.84M | contest_id large_stringlengths 39 78 | correct_answer large_stringlengths 0 3.36M | metadata dict |
|---|---|---|---|
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from functools import partial
from itertools import groupby
from operator import ne
def repeat_adjacent(s):
xs = [sum((1 for _ in grp)) for (key, grp)... | https://www.codewars.com/kata/58b8dccecf49e57a5a00000e | ['ccccoooooooooooooooooooooooddee'] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
s = int(input())
N = s + s * s + s * s * s
print(N)
[/CODE]
[OUTPUT]
399
[/OUTPUT]
Your final answer should be a JSON object of the format - {"input... | https://atcoder.jp/contests/abc172/tasks/abc172_a | 7 | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import logging
from collections import defaultdict
fmt = '%(levelname)s - %(name)s (line:%(lineno)s) - %(message)s'
formatter = logging.Formatter(fmt)
c... | https://codeforces.com/problemset/problem/978/F | 10 4
5 4 1 5 5 4 12 2 2 1
4 6
2 1
10 8
3 8
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Sorting', 'Data structures', 'Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(A, B) = map(int, input().split())
print(max([0, A - B - B]))
[/CODE]
[OUTPUT]
84
[/OUTPUT]
Your final answer should be a JSON object of the format ... | https://atcoder.jp/contests/abc143/tasks/abc143_a | 126 21 | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
rule = ['0', '1', '1', '1', '1', '0', '0', '0']
def rule30(list_, n):
res = ''.join(('1' if x == 1 else '0' for x in list_))
for _ in range(n):
res... | https://www.codewars.com/kata/5581e52ac76ffdea700000c1 | [[0], 3] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Bit manipulation', 'Data structures', 'Ad-hoc']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(n, m) = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(n)]
B = [list(map(int, input().split())) for _ in range(m)]
for a... | https://atcoder.jp/contests/abc057/tasks/abc057_b | 5 5
-78895993 -130838308
-100000000 100000000
100000000 -77523951
000000000 000010000
-1 2
3 0
100001000 100000010
000000001 -110988549
-8995723 000000000
-100000000 -24811221 | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import math
def prime(n):
while n % 2 == 0:
lis.add(2)
n = n / 2
for i in range(3, int(math.sqrt(n)) + 1, 2):
while n % i == 0:
lis.add(i)
... | https://codeforces.com/problemset/problem/151/C | 614125
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Number theory', 'Game theory', 'Mathematics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
S = input()
T = [[0] * 10 for i in range(10)]
for i in range(1, len(S)):
T[int(S[i - 1])][int(S[i])] += 1
C = [[[[0 for i in range(10)] for j in range(... | https://codeforces.com/problemset/problem/1202/B | 019258473
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Dynamic programming', 'Complete search', 'Shortest paths']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
q = input()
q = q[::-1]
arr = ['A', 'E', 'I', 'O', 'U', 'Y', 'a', 'e', 'i', 'o', 'u', 'y']
for j in q:
if j.isalpha():
try:
p = arr.index(j)
pr... | https://codeforces.com/problemset/problem/49/A | Is ht a b`nana ?
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
in_num = int(input())
out_num = 0
times = 0
while True:
tem = int(in_num % 10)
if int(in_num / 10) == 0 and tem == 9:
pass
elif int(in_num / 10) !=... | https://codeforces.com/problemset/problem/514/A | 429325660016
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation', 'Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def optimum_location(students, locations):
def total_distance(loc):
x_dist = sum((abs(loc['x'] - x) for (x, y) in students))
y_dist = sum((abs(loc... | https://www.codewars.com/kata/55738b0cffd95756c3000056 | [[[152, 7], [1, 211], [14, 56], [12, 4], [142, 7]], [{'id': 1, 'x': 63, 'y': 55}, {'id': 2, 'x': 55, 'y': 21}, {'id': 3, 'x': 144, 'y': 12}]] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from sys import exit
n = int(input())
d = [int(z) for z in input().split()]
if d[-1] == 0:
print('UP')
exit(0)
if d[-1] == 15:
print('DOWN')
exit(0)... | https://codeforces.com/problemset/problem/719/A | 6
10 11 12 13 14 15
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from bisect import bisect_left
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))
(sum_a, sum_b) ... | https://codeforces.com/problemset/problem/620/D | 5
7 8 3 1 1
4
1 1 1 1
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Sorting', 'Amortized analysis']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(x, y) = list(map(int, input().split()))
def f():
if y == 0:
return False
if y == 1:
if x == 0:
return True
return False
s = y - 1
if s > ... | https://codeforces.com/problemset/problem/922/A | 453462237 167520068
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def is_divisible(n, x, y):
count = n % x or n % y
if count == 0:
return True
elif count != 0:
return False
[/CODE]
[OUTPUT]
[True]
[/OUTPUT]
Y... | https://www.codewars.com/kata/5545f109004975ea66000086 | [48, 3, 4] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
a = list(map(int, input().split()))
c = 0
for cc in a:
if cc < 0:
c += 1
if 0 in a:
print(sum((abs(x) for x in a)))
elif n % 2 == 0... | https://codeforces.com/problemset/problem/302/C | 7
-5 -10 12 40 20 -33 23 12 -23 6 -32 14 24
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Constructive algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from collections import deque as dd
x = dd(input())
a = []
if len(x) % 2 == 1:
a.append(x.popleft())
while x:
a.append(x.pop())
a.append(x.popleft())... | https://codeforces.com/problemset/problem/1085/A | ecunhp
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['String algorithms', 'Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def get_issuer(n):
n = str(n)
if n[:1] == '4' and (len(n) == 13 or len(n) == 16):
return 'VISA'
if (n[:2] == '34' or n[:2] == '37') and len(n) == 1... | https://www.codewars.com/kata/5701e43f86306a615c001868 | [5105105105105100] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def longest(s1, s2):
freq = {}
for c in list(s1):
freq[c] = freq.get(c, 0) + 1
for c in list(s2):
freq[c] = freq.get(c, 0) + 1
l = sorted([c for... | https://www.codewars.com/kata/5656b6906de340bd1b0000ac | ['loopingisfunbutdangerous', 'lessdangerousthancoding'] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
a = int(input())
b = int(input()) // 2
x = int(input()) // 4
if x <= 0:
print('0')
elif b <= 0:
print('0')
elif a <= 0:
print('0')
else:
print(min(a... | https://codeforces.com/problemset/problem/746/A | 174
762
987
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Mathematics', 'Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def greet(name):
if name is '' or name is None:
return None
else:
return f'hello {name}!'
[/CODE]
[OUTPUT]
[None]
[/OUTPUT]
Your final answer s... | https://www.codewars.com/kata/55955a48a4e9c1a77500005a | [''] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import random
from sys import stdout
def is_Prime(n):
if n != int(n):
return False
n = int(n)
if n == 0 or n == 1 or n == 4 or (n == 6) or (n == 8... | https://codeforces.com/problemset/problem/1091/G | 3
108377867635689823460701680967408791449147595738301663734949561146810411329167 162345195533123928855534295599873773144889880136187394699226388624729007240581 39901960826568298254771799308017918343341802745686160866294488551394132713267
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Number theory', 'Mathematics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
MOD = 10 ** 9 + 7
fac = [1 for k in range(200010)]
inv = [1 for k in range(200010)]
finv = [1 for k in range(200010)]
for k in range(2, 200010):
fac[k]... | https://atcoder.jp/contests/abc042/tasks/arc058_b | 100000 100000 99999 99999
| {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
lst1 = [int(i) for i in input().split()]
lst2 = [int(i) for i in input().split()]
(a, b) = (0, 0)
for (x, y) in zip(lst1, lst2):
(a, b... | https://codeforces.com/problemset/problem/1195/C | 5
2 7 6 8 2
4 1 0 7 9
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Dynamic programming']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import heapq
class Heapq:
def __init__(self, arr, desc=False):
if desc:
arr = [-a for a in arr]
self.sign = -1 if desc else 1
self.hq = arr
... | https://atcoder.jp/contests/abc127/tasks/abc127_f | 4
1 -1000000000 0000001000
1 -1000000000 1000000000
1 -1000000000 1000000000
2 | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def read_ints():
return list(map(int, input().split()))
d = {'0': '1', '1': '0'}
def change(rest, a, b, c):
v = list(rest)
for i in (a, b, c):
v[i... | https://codeforces.com/problemset/problem/1440/C2 | 5
2 2
10
11
3 3
001
100
110
4 4
1111
1100
0110
1101
5 3
01011
01011
00010
11011
11000
2 3
011
001
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Greedy algorithms', 'Graph algorithms', 'Implementation', 'Constructive algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def palindrome(n):
if not isinstance(n, int) or n < 0:
return 'Not valid'
s = f'{n}'
return any((n in s[i:i + 2] for (i, n) in enumerate(s[:-1], 1)... | https://www.codewars.com/kata/58de819eb76cf778fe00005c | ['ACCDDCCA'] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
a = []
for x in input().split():
x = int(x)
if x:
a.append(x)
n = len(a)
edges = set()
for d in range(64):
p = 1 << d
c = []
for... | https://codeforces.com/problemset/problem/1205/B | 7
69206016 134250496 2149580800 2147516416 7667730907514109 146366987889541120 2251799947902976
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Complete search', 'Bit manipulation', 'Graph algorithms', 'Shortest paths']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
R = lambda : map(int, input().split())
n = int(input())
L = sorted(R())
mi = (L[n - 1] - L[0]) * (L[2 * n - 1] - L[n])
k = L[2 * n - 1] - L[0]
for i in ... | https://codeforces.com/problemset/problem/1013/C | 1
553296794 23577639
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Mathematics', 'Sorting', 'Implementation', 'Complete search']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def solve(arr):
res = []
for first in (arr[0] - 1, arr[0], arr[0] + 1):
for second in (arr[1] - 1, arr[1], arr[1] + 1):
(val, step, count) = (sec... | https://www.codewars.com/kata/5b77b030f0aa5c9114000024 | [[1, 2, 3]] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
s = input()
t = input()
letter_index_s = {}
letter_index_t = {}
base_s = set()
base_t = set()
for i in set(s):
letter_index_s[i] = set... | https://codeforces.com/problemset/problem/1141/D | 10
codegcroer
eerdtvidoh
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation', 'Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import sys
from collections import defaultdict
class MaxFlow(object):
def __init__(self):
self.edges = defaultdict(lambda : defaultdict(lambda : 0)... | https://codeforces.com/problemset/problem/1198/E | 7 6
2 1 2 1
4 2 4 3
2 5 2 5
2 3 5 3
1 2 1 2
3 3 5 3
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Graph algorithms', 'Flows and cuts']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
a = list(map(int, input().split()))
(q, w) = (0, 0)
for i in a:
if i == 25:
q += 1
elif i == 50:
q -= 1
w += 1
elif w > 0:
w... | https://codeforces.com/problemset/problem/349/A | 10
25 25 25 25 25 25 25 25 25 25
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation', 'Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def arithmetic_sequence_elements(a, r, n):
return ', '.join((str(a + r * x) for x in range(n)))
[/CODE]
[OUTPUT]
['1, 3, 5, 7, 9']
[/OUTPUT]
Your fi... | https://www.codewars.com/kata/55caf1fd8063ddfa8e000018 | [1, 2, 5] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals', 'Data structures']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def main():
(n, k) = map(int, input().split())
cnt = [0] * k
ans = 0
arr = map(int, input().split())
for el in arr:
t = el % k
if cnt[(k - t) %... | https://codeforces.com/problemset/problem/1133/B | 7 3
1 2 0 2 2 0 10
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Number theory', 'Mathematics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def reduce_pyramid(b):
(p, r) = (1, b[0])
for i in range(1, len(b)):
p = p * (len(b) - i) // i
r += b[i] * p
return r
[/CODE]
[OUTPUT]
[88]
[/O... | https://www.codewars.com/kata/5cc2cd9628b4200020880248 | [[13, 1, 21, 9]] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
3
from math import factorial as fact
N = 55
c = [1]
for i in range(N):
c.append(fact(i))
dp = [0] * N
dp[0] = 1
for i in range(1, N):
for j in range(i... | https://codeforces.com/problemset/problem/1279/E | 5
3 3
5 15
4 13
6 8
4 2
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Dynamic programming', 'Combinatorics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def main():
(n, k) = list(map(int, input().split()))
(aa, cnt, res) = ([], {}, 0)
scale = [10 ** i + 1 for i in range(11)]
for w in input().split():... | https://codeforces.com/problemset/problem/1029/D | 100 2
38 415 2960 8618 8531 6194 6811 503 3955 1056 7147 9144 8424 5766 4492 2994 978 1102 2028 3569 930 6106 12478 7714 5179 7801 4768 9025 6562 4469 5578 5224 6845 362 3229 4769 4191 7895 7490 2200 6215 3458 5037 8201 7914 8300 7398 1620 3428 6878 8069 3748 4808 6460 6711 3492 9121 4011 2210 10695 9092 2689 2005 9802... | {
"question_source": "codeforces",
"source": "taco",
"tags": "['Mathematics', 'Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def validate_hello(greetings):
greetings = greetings.lower()
if 'hello' in greetings or 'hallo' in greetings or 'ciao' in greetings or ('salut' in gre... | https://www.codewars.com/kata/56a4addbfd4a55694100001f | ['ciao bella!'] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def dig_pow(n, p):
digit_power = sum((int(x) ** pw for (pw, x) in enumerate(str(n), p)))
if digit_power % n == 0:
return digit_power / n
return -1
... | https://www.codewars.com/kata/5552101f47fc5178b1000050 | [2427, 1] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals', 'Mathematics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
mini = 10 ** 6
maxi = -1
tt = 0
for (indice, i) in enumerate(map(int, input().split())):
if indice:
if i < mini or i > maxi:
tt +... | https://codeforces.com/problemset/problem/155/A | 5
100 65 53 7 81
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Complete search']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
x = input()
fx = sum(map(int, x))
print('Yes' if int(x) % fx == 0 else 'No')
[/CODE]
[OUTPUT]
Yes
[/OUTPUT]
Your final answer should be a JSON objec... | https://atcoder.jp/contests/abc080/tasks/abc080_b | 18 | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def calculate_age(year_of_birth, current_year):
year = year_of_birth - current_year
c1 = f"You are {abs(year)} {['year', 'years'][abs(year) != 1]} old... | https://www.codewars.com/kata/5761a717780f8950ce001473 | [2000, 2000] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import math, string, itertools, fractions, heapq, collections, re, array, bisect
from itertools import chain, dropwhile, permutations, combinations
from... | https://codeforces.com/problemset/problem/550/D | 41
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Graph algorithms', 'Implementation', 'Constructive algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(_, *ss) = open(0).read().split()
from collections import Counter
c = Counter(ss)
mx = c.most_common(1)[0][1]
for s in sorted((key for (key, count) in c... | https://atcoder.jp/contests/abc155/tasks/abc155_c | 8
buffalo
buffalo
buffalo
buffalo
olaffub
buffalo
buffalo
buffalo | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from functools import reduce
def find_min_max_product(arr, k):
if k <= len(arr):
arr = sorted(arr, key=abs)
lasts = arr[-k:]
v1 = reduce(int.__m... | https://www.codewars.com/kata/5b05867c87566a947a00001c | [[-1, -2, -3, -4], 2] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Data structures']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from decimal import *
def sum_prod(strexpression):
splitByPlus = strexpression.split('+')
for x in range(0, len(splitByPlus)):
splitByPlus[x] = mul... | https://www.codewars.com/kata/5759513c94aba6a30900094d | ['0.5*1.2*56+9.6*5*81+1'] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
s = [int(i) for i in input().split()]
s1 = s.copy()
for i in range(n - 1):
if s[-1 * i - 1] == s[-1 * i - 2]:
s1.pop(-1 * i - 1)
el... | https://codeforces.com/problemset/problem/1143/A | 16
0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(n, U) = list(map(int, input().split()))
E = list(map(int, input().split()))
ind_i = 0
prev_ind_k = ind_i + 2
maxi_efficiency = -1
turn = 0
for ind_i in... | https://codeforces.com/problemset/problem/924/B | 4 2
2 3 5 7
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Sorting', 'Amortized analysis', 'Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def chk(d):
s = d * (k - 1) * k // 2
if n - s > (k - 1) * d:
if (n - s) % d == 0:
return True
return False
(n, k) = map(int, input().split())
no... | https://codeforces.com/problemset/problem/803/C | 7 3
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Greedy algorithms', 'Mathematics', 'Constructive algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from sys import stdin
input = stdin.readline
for _ in range(int(input())):
(n, m, k) = map(int, input().split())
if k >= m:
k = m - 1
a = list(map(... | https://codeforces.com/problemset/problem/1291/C | 4
6 4 2
2 9 2 3 8 4
4 4 1
2 13 60 4
4 1 5
1 0 2 1
2 2 2
1 2
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Data structures', 'Implementation', 'Complete search']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def tickets(people, cost=25, bills=[100, 50, 25]):
count = dict.fromkeys(bills, 0)
for change in people:
count[change] += 1
change -= cost
for b... | https://www.codewars.com/kata/555615a77ebc7c2c8a0000b8 | [[25, 25, 25, 25, 50, 100, 50]] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
a = sorted(input().split())
r = len({*a}) - 1
a = sorted(a, key=lambda x: (x[1], x[0]))
(v, s) = [*zip(*a)]
c = 1
for i in range(1, 3):
if s[i] == s[i ... | https://codeforces.com/problemset/problem/1191/B | 6s 6s 6s
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation', 'Complete search']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(n, v) = map(int, input().split())
if v >= n - 1:
print(n - 1)
else:
total = v
i = 2
while n - i > v - 1:
total += i
i += 1
print(total)
[/COD... | https://codeforces.com/problemset/problem/1113/A | 20 2
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Dynamic programming', 'Mathematics', 'Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
k = 0
d = [0] * 200005
x = int(input())
p = list(map(int, input().split(' ')))
for i in range(len(p)):
d[p[i]] = i
for i in range(1, x):
k += abs(d[i ... | https://codeforces.com/problemset/problem/612/B | 5
1 3 5 4 2
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Mathematics', 'Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def nth_even(n):
if n == 3:
return 4
else:
return n // 2 * 2 if n < 3 else n * 2 - 2
[/CODE]
[OUTPUT]
[4]
[/OUTPUT]
Your final answer should be... | https://www.codewars.com/kata/5933a1f8552bc2750a0000ed | [3] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Mathematics', 'Ad-hoc']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import re
S = input()
m = re.search('\\A([a-z]+)\\1', S[:len(S) - 1])
print(len(m.group(0)))
[/CODE]
[OUTPUT]
6
[/OUTPUT]
Your final answer should b... | https://atcoder.jp/contests/abc066/tasks/abc066_b | bbabbacb`ccb | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from co... | https://atcoder.jp/contests/abc149/tasks/abc149_a | smtf ltgu | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from collections import defaultdict
import sys
[n, A] = map(int, input().strip().split())
cis = list(map(int, input().strip().split()))
cnt = defaultdic... | https://codeforces.com/problemset/problem/818/D | 6 0
3 0 1 4 2 0
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Data structures', 'Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def simplify(n):
d = max((m for m in range(1, int(n ** 0.5) + 1) if m * m <= n and n % (m * m) == 0))
r = n // (d * d)
return str(d) if r == 1 else '... | https://www.codewars.com/kata/5850e85c6e997bddd300005d | [200] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def validate_pin(pin):
return {6: True if [1 for x in pin if x.isdigit()].count(1) == 6 and len(pin) == 6 else False, 4: True if [1 for x in pin if x.i... | https://www.codewars.com/kata/55f8a9c06c018a0d6e000132 | ['1111'] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def lsorter2(l):
intsec = [(a, b) for (a, b) in zip(l, sorted(l)) if a != b]
return list(zip(*intsec))
def naturalSwap(l):
x1 = lsorter2(l)
ori = l... | https://www.codewars.com/kata/58aa8b0538cf2eced5000115 | [[9, 9, 9, 9, 9, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7]] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Sorting']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
a = list(input().split())
b = len(set(a))
print(b - 1 + b % 2)
[/CODE]
[OUTPUT]
9
[/OUTPUT]
Your final answer should be a JSON obje... | https://atcoder.jp/contests/abc053/tasks/arc068_b | 15
1 1 9 0 0 12 1 -1 1 6 -1 2 13 2 3 | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def solve(n):
x = str(n)
res = [x] + [str(int(x[:i]) - 1) + '9' * (len(x) - i) for i in range(1, len(x))]
return int(max(res, key=lambda x: (sum(map(... | https://www.codewars.com/kata/5b162ed4c8c47ea2f5000023 | [100] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def visit(r, g, b):
if r < 0 or g < 0 or b < 0:
return
if vis[r][g][b]:
return
vis[r][g][b] = True
if r > 1:
visit(r - 1, g, b)
if g > 1:
v... | https://codeforces.com/problemset/problem/626/B | 200
BBRBGGGGBRBRRRBRGRGBGRRBBRBGRGBGGGRBBBGRGRGGRRRRRRGBGBBBGRRGGGRRBRGBRBBBGGBGRRRBRRGBGBBBGBGGBBBBGRGRBGBGGBBRBRRRBRRRRBGGBGBGRGGRRRGGRBGGBBBBBBBRBGBGBGRBBGGRRRGRRGBGRGBBRRGRGBRGRGRGRRGBGBGBGGGRBBRRGRBB
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Dynamic programming', 'Mathematics', 'Constructive algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def find_2nd_largest(arr):
(a, b) = (float('-inf'), float('-inf'))
for n in arr:
if isinstance(n, int):
if n > b:
b = n
if b > a:
(a, ... | https://www.codewars.com/kata/55a58505cb237a076100004a | [[1, 1, 1, 1, 1, 1, 1]] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
l = input().split()
(a, b, x) = map(int, l)
in_hand = x - 2
if b > a:
ans = '1'
one = 1
zero = 0
for i in range(in_hand):
if i % 2 == 1:
ans +=... | https://codeforces.com/problemset/problem/1003/B | 7 146 12
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Constructive algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import random, math
from copy import deepcopy as dc
def randomNumber(s, e):
return random.randint(s, e)
def randomArray(s, e, s_size, e_size):
size ... | https://codeforces.com/problemset/problem/525/B | keicnqmuqinhsmtudqcilocxkbqgzhbkitmqwttdyoyvcbxjncwjryzknubpacsngorexaldfurondbednowemnnlphhboxcfavs
2
1 14
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Greedy algorithms', 'String algorithms', 'Mathematics', 'Constructive algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
params = [int(x) for x in input().split(' ')]
nums = [int(x) for x in input().split(' ')]
nums_sorted = sorted(nums)
if params[1] > 2:
print(nums_sorte... | https://codeforces.com/problemset/problem/870/B | 5 2
6 2 2 3 3
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
a = []
b = 1
for i in range(1, n):
if b + i <= n:
b = b + i
else:
u = n - b
b = i - u
a.append(b)
for i in a:
print(i, '', en... | https://codeforces.com/problemset/problem/46/A | 8
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation', 'Complete search']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
lis = [25, 18, 15, 12, 10, 8, 6, 4, 2, 1] + [0] * 52
li = dict()
for i in range(n):
for j in range(int(input())):
player = input()
... | https://codeforces.com/problemset/problem/24/B | 5
3
Webber
Trulli
Jones
9
Villeneuve
Berger
JimClark
ReneArnoux
Kubica
Jones
Scheckter
Kobayashi
JamesHunt
10
Trulli
JackBrabham
Kobazashi
Nakajima
Andretti
Scheckter
DeLaRosa
ReneArnoux
Kovalainen
Jones
3
Berger
JimClark
Trulli
15
Nakajima
Villeneuve
Berger
Trulli
JamesHunt
Massa
ReneAsnoux
Kubica
JimClark
DeLaRosa
Ja... | {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def counting_valleys(s):
res = current = 0
for c in s:
if c == 'U':
current += 1
if current == 0:
res += 1
elif c == 'D':
current -= ... | https://www.codewars.com/kata/5da9973d06119a000e604cb6 | ['UFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFUUFFDDFDUDFUFU'] | {
"question_source": "codewars",
"source": "taco",
"tags": "['String algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def music():
number = [int(x) for x in input().strip().split(' ')]
src = [int(x) for x in input().strip().split(' ')]
max_value = number[0] // number... | https://codeforces.com/problemset/problem/723/C | 1 1
1
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
for _ in range(int(input())):
l = input().split()
if int(l[1]) >= 2400:
if int(l[2]) > int(l[1]):
print('YES')
exit()
print('NO')
[/CODE]
[O... | https://codeforces.com/problemset/problem/681/A | 1
ACA 2400 33
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(n, a, b, c) = map(int, input().split())
DP = []
for i in range(100005):
DP.append(-1000000000.0)
DP[0] = 0
for i in range(1, n + 1):
if i >= a:
DP[... | https://codeforces.com/problemset/problem/189/A | 3999 2 1 3
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Dynamic programming', 'Complete search']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from string import ascii_uppercase, ascii_lowercase
D = {c: str(i) for string in (ascii_uppercase, ascii_lowercase) for (i, c) in enumerate(string, 1)}
... | https://www.codewars.com/kata/55d6a0e4ededb894be000005 | ['this is a long string!! Please [encode] @C0RrEctly'] | {
"question_source": "codewars",
"source": "taco",
"tags": "['String algorithms', 'Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def index(array, n):
if n > -1 and n < len(array):
product = array[n] ** n
else:
product = -1
return product
[/CODE]
[OUTPUT]
[-1]
[/OUTPUT]
Y... | https://www.codewars.com/kata/57d814e4950d8489720008db | [[75, 68, 35, 61, 9, 36, 89, 0, 30], 10] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals', 'Data structures']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import sys
import random
import copy
from itertools import permutations, combinations
from math import sqrt, fabs, ceil
from collections import namedtup... | https://codeforces.com/problemset/problem/1056/A | 10
6 73 60 96 87 4 10
7 87 73 25 19 96 4 60
7 19 60 87 4 25 96 73
6 4 87 60 19 25 96
5 25 96 4 73 60
6 25 4 60 73 87 96
6 60 96 73 87 19 4
6 96 4 73 87 19 60
6 4 73 87 96 19 60
6 19 87 60 73 4 96
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
word = input()
length = len(word)
acceptable2 = [None] * length
acceptable2[0] = True
acceptable2[1] = False
acceptable2[2] = True
acceptable2[3] = Fals... | https://codeforces.com/problemset/problem/666/A | iosdwvzerqfi
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['String algorithms', 'Dynamic programming', 'Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(n, q) = list(map(int, input().split()))
a = input()
Q = []
for _ in range(q):
Q.append(list(map(int, input().split())))
d = [0]
ab = 0
for i in a:
if... | https://codeforces.com/problemset/problem/1062/C | 10 4
1100111101
3 5
7 9
8 10
2 2
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Mathematics', 'Implementation', 'Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import sys
n = int(sys.stdin.readline())
print((n + 2 * n * (n - 1) // 2 + n * (n - 1) * (n - 2) // 6) * (n + 4 * n * (n - 1) // 2 + 6 * n * (n - 1) * (... | https://codeforces.com/problemset/problem/630/G | 25
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Combinatorics', 'Mathematics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
MOD = 998244353
if n == 1:
print(pow(2, MOD - 2, MOD))
return
if n == 2:
print(1)
print(1)
return
div = pow(pow(2, n - 1, MOD), MO... | https://atcoder.jp/contests/arc109/tasks/arc109_e | 9
| {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from functools import lru_cache
@lru_cache(maxsize=None)
def fact(n):
return 1 if n < 2 else n * fact(n - 1)
@lru_cache(maxsize=None)
def comb(n, k):... | https://www.codewars.com/kata/5b5f7f7607a266914200007c | [4, 4] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Number theory', 'Combinatorics', 'Dynamic programming', 'Mathematics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
class SortedList:
def __init__(self, iterable=[], _load=200):
values = sorted(iterable)
self._len = _len = len(values)
self._load = _load
self... | https://codeforces.com/problemset/problem/1228/D | 12 17
1 4
2 4
1 5
2 5
1 6
2 6
1 7
2 7
1 8
2 8
1 9
2 9
1 10
2 10
1 11
2 11
3 12
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Graph algorithms', 'Constructive algorithms', 'String algorithms', 'Implementation', 'Complete search']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import sys
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [[c] * b for i in range(a)]
def list3d(a, b, c, d):
return... | https://codeforces.com/problemset/problem/1355/D | 9 10
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Mathematics', 'Constructive algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
p = list(map(float, input().split()))
val = [0.0]
for j in range(n):
val.append((val[-1] + 1.0) * p[j])
dp = [0 for i in range(n + 1)]... | https://codeforces.com/problemset/problem/235/B | 10
0.999453 0.999188 0.998398 0.999609 1.403585258480948 0.999426 0.998026 1.7911299872505193 0.998842 0.999807
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Dynamic programming', 'Mathematics', 'Probability']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def cards_and_pero(s):
cards = [s[i - 3:i] for i in range(3, len(s) + 1, 3)]
if len(set(cards)) < len(cards):
return [-1, -1, -1, -1]
return [13 - ... | https://www.codewars.com/kata/58fd4bbe017b2ed4e700001b | ['H02H10P11H02'] | {
"question_source": "codewars",
"source": "taco",
"tags": "['Fundamentals']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
p = []
for i in range(n):
l = list(map(int, input().split()))
p.append(l[0] + l[1])
p.sort()
print(p[-1])
[/CODE]
[OUTPUT]
22
[/OU... | https://codeforces.com/problemset/problem/1047/B | 2
20 1
11 11
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Geometry', 'Mathematics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = input('')
result = ''
if int(n) < 0:
if int(n[-1]) > int(n[-2]):
result = n[:len(n) - 1]
else:
result = n[:len(n) - 2] + n[-1]
else:
result =... | https://codeforces.com/problemset/problem/313/A | -232644
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Number theory', 'Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import sys
from collections import Counter
s = list(sys.stdin.buffer.readline().decode('utf-8').rstrip())
s_cnt = Counter(s)
t_cnt = Counter(sys.stdin.b... | https://codeforces.com/problemset/problem/825/D | mqwsyohetbfrdzutysww
qrrthesuub
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Sorting', 'Implementation', 'Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(x, y) = map(int, input().split())
ar = [y, y, y]
ans = 0
while min(ar) < x:
ar.sort()
ar[0] = ar[1] + ar[2] - 1
ans += 1
print(ans)
[/CODE]
[OUTPU... | https://codeforces.com/problemset/problem/712/C | 57825 11576
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Mathematics', 'Greedy algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
n = int(input())
(p, q) = (1, 1)
for _ in range(n):
(t, a) = map(int, input().split())
n = max((p + t - 1) // t, (q + a - 1) // a)
(p, q) = (n * t, n... | https://atcoder.jp/contests/abc046/tasks/arc062_a | 3
4 3
3 2
5 4 | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from collections import deque
(N, M) = map(int, input().split())
F_C_of_S = [{} for i in range(N)]
C_of_S = {}
parent = [-1] * M
def root(x):
if paren... | https://atcoder.jp/contests/arc061/tasks/arc061_c | 3 0
1 0 1
3 3 1
3 2 0 | {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
(n, m) = map(int, input().split())
dic = [0] * n
for i in range(0, m):
dics = [int(i) for i in input().split()]
intdic = dics.index(max(dics))
dic[in... | https://codeforces.com/problemset/problem/570/A | 3 4
0 0 -1
0 0 0
1 0 0
1 2 3
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Implementation']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import sys
class Node:
def __init__(self, d):
global nodes
self.ch = {}
self.a = [[], []]
self.d = d
nodes += [self]
nodes = []
pairs = []
... | https://codeforces.com/problemset/problem/566/A | 5
ydbmnfg
galya
obris
lmci
toshik
blibo
nhrot
gandelf
guals
gaiadrlem
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Tree algorithms', 'Graph traversal', 'String algorithms']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import sys
import re
import collections
import threading
import bisect
N = 0
Last = []
AA = [0 for _ in range(100005)]
LL = [0 for _ in range(100005)]
B... | https://codeforces.com/problemset/problem/486/E | 24
29 65 100 75 27 61 87 83 104 61 37 38 49 86 48 37 56 21 67 1 30 20 81 23
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['String algorithms', 'Greedy algorithms', 'Dynamic programming', 'Mathematics', 'Data structures']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
from functools import reduce
mod = 1000000007
n = input()
num = list(map(int, input().split()))
flag = 1 if len(list(filter(lambda x: x % 2 == 0, num)))... | https://codeforces.com/problemset/problem/697/E | 9
174496219779575399 193634487267697117 972518022554199573 695317701399937273 464007855398119159 881020180696239657 296973121744507377 544232692627163469 751214074246742731
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Number theory', 'Combinatorics', 'Mathematics']"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import math
(a, b, c, d) = list(map(int, input().split()))
def calc(x):
nonlocal c, d
l = c // math.gcd(c, d) * d
return x - x // c - x // d + x // ... | https://atcoder.jp/contests/abc131/tasks/abc131_c | 999999999 999999999999999999 200 50000
| {
"question_source": "atcoder",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
import operator
from functools import reduce
def share_price(invested, changes):
multipliers = (1.0 + c / 100.0 for c in changes)
product = reduce(op... | https://www.codewars.com/kata/5603a4dd3d96ef798f000068 | [1000, [0, 2, 3, 6]] | {
"question_source": "codewars",
"source": "taco",
"tags": "[]"
} |
You are an expert coding professional. Given a code snippet and an output, your task is to predict the exact input of the code that produces the given output.
[CODE]
def gcd(a, b):
while a and b:
a %= b
if a:
b %= a
return a + b
def gcd2(A):
r = A[1] - A[0]
for i in (2, 3):
r = gcd(r, A[i] - A[0])
retu... | https://codeforces.com/problemset/problem/1276/E | 0 3 -4 3
2 4 0 0
| {
"question_source": "codeforces",
"source": "taco",
"tags": "['Constructive algorithms']"
} |
End of preview. Expand in Data Studio
CodeIO dataset constructed from TACO. Can be extended to other datasets with public test cases relatively easily, and io_from_mcq can be modified to have multiple correct options Five Tasks, each containing 100k instances each (pending Goldilocks annotations)
- i_from_o_direct: Predict the input directly from the output and code
- o_from_i_direct: Predict the output directly from the input and code
- i_from_o_mcq: Select the correct input from 4 options, given the output and the code
- o_from_i_mcq: Select the correct output from 4 options, given the input and the code
- io_from_mcq: Given a code snippet and four options, select the correct input-output pair (only one correct answer)
- Downloads last month
- 9