message stringlengths 2 23.4k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 129 108k | cluster float64 6 6 | __index_level_0__ int64 258 216k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any number of times. But each new handle must not be equal to any handle that is already used or that was used at s... | instruction | 0 | 12,864 | 6 | 25,728 |
Tags: data structures, dsu, strings
Correct Solution:
```
#coding:utf-8
n = int( input())
names = {}
changes = 0
for i in range(n):
current, changed = map(str, input().split())
if current not in names:
names[changed] = current
changes += 1
else:
aux = names[current]
names.pop(current)
names[changed] = au... | output | 1 | 12,864 | 6 | 25,729 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any number of times. But each new handle must not be equal to any handle that is already used or that was used at s... | instruction | 0 | 12,865 | 6 | 25,730 |
Tags: data structures, dsu, strings
Correct Solution:
```
maps = {}
for i in range(int(input())):
old, new = input().split()
if old in maps:
maps[new] = maps[old]
del maps[old]
else:
maps[new] = old
print(len(maps))
for k, v in maps.items():
print(v + " " + k)
`... | output | 1 | 12,865 | 6 | 25,731 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Misha hacked the Codeforces site. Then he decided to let all the users change their handles. A user can now change his handle any number of times. But each new handle must not be equal to any handle that is already used or that was used at s... | instruction | 0 | 12,866 | 6 | 25,732 |
Tags: data structures, dsu, strings
Correct Solution:
```
n=int(input())
arr=[]
for i in range(n):
s=input()
a=s.split(' ')
arr.append(a)
array=[['' for col in range(n)]for row in range(2)]
a1=[[]for k in range(n)]
a1[0].append(arr[0][0])
a1[0].append(arr[0][1])
a2=[]
a2.append(arr[0][1])
p=1
while(p<n):
... | output | 1 | 12,866 | 6 | 25,733 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.
You are given two strings consist... | instruction | 0 | 13,014 | 6 | 26,028 |
Tags: implementation, strings
Correct Solution:
```
a,b=input(),input()
dict={}
d=[]
for x in list(input()):
if x in '0123456789':
d.append(x)
elif x == x.lower():
d.append(b[a.index(x)])
elif x==x.upper():
d.append(b[a.index(x.lower())].upper())
print(''.join(d))
``` | output | 1 | 13,014 | 6 | 26,029 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.
You are given two strings consist... | instruction | 0 | 13,015 | 6 | 26,030 |
Tags: implementation, strings
Correct Solution:
```
first = input()
second = input()
request = input()
first_d = {}
second_d = {}
for _, c in enumerate(first):
first_d[c] = _
for _, c in enumerate(second):
second_d[_] = c
ans = ""
for c in request:
lower_c = c.lower()
if lower_c not in first:
ans += c
else:... | output | 1 | 13,015 | 6 | 26,031 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.
You are given two strings consist... | instruction | 0 | 13,016 | 6 | 26,032 |
Tags: implementation, strings
Correct Solution:
```
first = str(input())
second = str(input())
line = (input())
result = ''
for word in line:
if word.isdigit():
result+=word
else:
i = first.find(word)
if i == -1:
i = (first.upper()).find(word)
result += second[i].... | output | 1 | 13,016 | 6 | 26,033 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.
You are given two strings consist... | instruction | 0 | 13,017 | 6 | 26,034 |
Tags: implementation, strings
Correct Solution:
```
a = input()
b = input()
c = input()
dic = {}
for i in range(26):
dic[a[i]] = b[i];
d = ""
for i in range(len(c)):
if c[i].lower() not in a:
d += c[i]
elif c[i].isupper():
d += (dic[c[i].lower()]).upper()
else:
d += dic[c[i]]
pri... | output | 1 | 13,017 | 6 | 26,035 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.
You are given two strings consist... | instruction | 0 | 13,018 | 6 | 26,036 |
Tags: implementation, strings
Correct Solution:
```
s1=input()
s2=input()
s3=input()
for i in range(len(s3)):
try:
k=s1.index(s3[i].lower())
if s3[i].lower()==s3[i]:
print(s2[k],end="")
else:
print(s2[k].upper(),end="")
except:
print(s3[i],... | output | 1 | 13,018 | 6 | 26,037 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.
You are given two strings consist... | instruction | 0 | 13,019 | 6 | 26,038 |
Tags: implementation, strings
Correct Solution:
```
x=input()
y=input()
t=input()
r=''
for i in t:
if(i.isupper()):
w=i.lower()
for j in range(26):
if(x[j]==w):
r=r+y[j].upper()
elif(i.islower()):
for j in range(26):
if(x[j]==i):
r=... | output | 1 | 13,019 | 6 | 26,039 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.
You are given two strings consist... | instruction | 0 | 13,020 | 6 | 26,040 |
Tags: implementation, strings
Correct Solution:
```
s = input()
t = input()
d = {}
for i in range(26):
d[s[i]] = t[i]
w = input()
result = ''
for i in range(len(w)):
if w[i].isupper() and 65 <= ord(w[i]) <= 90:
result += d[w[i].lower()].upper()
elif 97 <= ord(w[i]) <= 122:
result += d[w[i]]
... | output | 1 | 13,020 | 6 | 26,041 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.
You are given two strings consist... | instruction | 0 | 13,021 | 6 | 26,042 |
Tags: implementation, strings
Correct Solution:
```
a = input()
b = input()
c = input()
d = dict((a[i], b[i]) for i in range(0, len(a)))
s = ''
for _ in c:
if _.isupper():
_ = d[_.lower()].upper()
elif _.islower():
_ = d[_]
s += _
print(s)
``` | output | 1 | 13,021 | 6 | 26,043 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a r... | instruction | 0 | 13,076 | 6 | 26,152 |
Tags: greedy, strings
Correct Solution:
```
length = int(input())
name = input()
i = 0
count =0
while i < length - 2:
if name[i] == name[i+1] == name[i+2] == 'x':
count+=1
else:
pass
i+=1
print(count)
``` | output | 1 | 13,076 | 6 | 26,153 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a r... | instruction | 0 | 13,077 | 6 | 26,154 |
Tags: greedy, strings
Correct Solution:
```
n = int(input())
counter = 0
delete = 0
s = input()
for c in s:
if c == 'x':
counter += 1
else:
delete += max(counter-2,0)
counter = 0
if counter != 0:
delete += max(counter-2,0)
print(delete)
``` | output | 1 | 13,077 | 6 | 26,155 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a r... | instruction | 0 | 13,078 | 6 | 26,156 |
Tags: greedy, strings
Correct Solution:
```
n=int(input())
s=list(input())
i,a,b=0,2,0#要给a一个初值,否则如果#2没有执行到的话,a就没有定义
while i<=n-3:
if s[i]==s[i+1]=='x':#2
a=i+2
if s[a]=='x':
while s[a]=='x':
b+=1
a+=1
i=a
if a==n:
... | output | 1 | 13,078 | 6 | 26,157 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a r... | instruction | 0 | 13,079 | 6 | 26,158 |
Tags: greedy, strings
Correct Solution:
```
input()
s = input()
ans = 0
while s.count('xxx'):
i = s.find('xxx')
s = s[:i] + s[i + 1:]
ans += 1
print(ans)
``` | output | 1 | 13,079 | 6 | 26,159 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a r... | instruction | 0 | 13,080 | 6 | 26,160 |
Tags: greedy, strings
Correct Solution:
```
a = int(input())
s = input()
if a ==2 or a==1:
print(0)
else:
b = 0
for i in range(a-2):
if s[i] == s[i+1] == s[i+2] == 'x':
b+=1
else:
pass
print(b)
``` | output | 1 | 13,080 | 6 | 26,161 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a r... | instruction | 0 | 13,081 | 6 | 26,162 |
Tags: greedy, strings
Correct Solution:
```
input()
a = list(input())
i = 1
c = 0
while i < len(a)-1:
if a[i] == 'x' and a[i - 1] == 'x' and a[i + 1] == 'x':
del a[i]
c += 1
else:
i += 1
print(c)
``` | output | 1 | 13,081 | 6 | 26,163 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a r... | instruction | 0 | 13,082 | 6 | 26,164 |
Tags: greedy, strings
Correct Solution:
```
n = int(input())
s = list(input())
con = 0
mov = 0
for i in range(n):
if s[i]=='x':
con+=1
else:
con=0
if con==3:
mov+=1
if (i+1)<n and s[i+1]=='x':
con=2
else:
con=0
print(mov)
``` | output | 1 | 13,082 | 6 | 26,165 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You can not just take the file and send it. When Polycarp trying to send a file in the social network "Codehorses", he encountered an unexpected problem. If the name of the file contains three or more "x" (lowercase Latin letters "x") in a r... | instruction | 0 | 13,083 | 6 | 26,166 |
Tags: greedy, strings
Correct Solution:
```
x = int(input())
t = input()
t1 = 0
r = 0
for i in range(x):
if t[i] == "x":
r = r + 1
else:
r = 0
if r >= 3:
t1 = t1 + 1
print(t1)
``` | output | 1 | 13,083 | 6 | 26,167 |
Provide tags and a correct Python 3 solution for this coding contest problem.
AquaMoon had n strings of length m each. n is an odd number.
When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!
In her rage,... | instruction | 0 | 13,548 | 6 | 27,096 |
Tags: interactive, math
Correct Solution:
```
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
def stringsum(a):
ans = 0
for x in a:
ans+=alpha.index(x)
return ans
t = int(input())
for i in range(t):
n,m = list(map(int,input().st... | output | 1 | 13,548 | 6 | 27,097 |
Provide tags and a correct Python 3 solution for this coding contest problem.
AquaMoon had n strings of length m each. n is an odd number.
When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!
In her rage,... | instruction | 0 | 13,549 | 6 | 27,098 |
Tags: interactive, math
Correct Solution:
```
t = int(input())
# testcases
for tests in range(t):
# plz don't copy the code, to avoid plagiarism issue
n,m = [int(i) for i in input().split(' ')]
hash_chrs = [{} for i in range(m)]
for i in range(n):
inp = input()
# plz don't copy the code... | output | 1 | 13,549 | 6 | 27,099 |
Provide tags and a correct Python 3 solution for this coding contest problem.
AquaMoon had n strings of length m each. n is an odd number.
When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!
In her rage,... | instruction | 0 | 13,550 | 6 | 27,100 |
Tags: interactive, math
Correct Solution:
```
import sys
input = sys.stdin.readline
def solve():
n, m = map(int, input().split())
original = [input() for _ in range(n)]
modified = [input() for _ in range(n-1)]
stolen_chars = []
for j in range(m):
chars_available = 0
for i in range(... | output | 1 | 13,550 | 6 | 27,101 |
Provide tags and a correct Python 3 solution for this coding contest problem.
AquaMoon had n strings of length m each. n is an odd number.
When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!
In her rage,... | instruction | 0 | 13,551 | 6 | 27,102 |
Tags: interactive, math
Correct Solution:
```
import sys
from bisect import bisect
from math import sqrt, ceil, floor
def input(): return sys.stdin.readline().strip()
def iinput(): return int(input())
def rinput(): return map(int, sys.stdin.readline().strip().split())
def get_list(): return list(map(int, sys.st... | output | 1 | 13,551 | 6 | 27,103 |
Provide tags and a correct Python 3 solution for this coding contest problem.
AquaMoon had n strings of length m each. n is an odd number.
When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!
In her rage,... | instruction | 0 | 13,552 | 6 | 27,104 |
Tags: interactive, math
Correct Solution:
```
import sys
from string import ascii_lowercase as alph
t = int(input())
for _ in range(t):
n, m = map(int, input().split())
cnt = [0] * m
for i in range(n):
ind = 0
for x in input():
cnt[ind] += alph.index(x) + 1
ind += 1
... | output | 1 | 13,552 | 6 | 27,105 |
Provide tags and a correct Python 3 solution for this coding contest problem.
AquaMoon had n strings of length m each. n is an odd number.
When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!
In her rage,... | instruction | 0 | 13,553 | 6 | 27,106 |
Tags: interactive, math
Correct Solution:
```
import sys
from copy import deepcopy
input = sys.stdin.readline
for _ in range(int(input())):
n, m = map(int, input().split())
total = [0 for _ in range(m)]
for i in range(n):
tmp = list(input().rstrip())
for j in range(len(tmp)):
to... | output | 1 | 13,553 | 6 | 27,107 |
Provide tags and a correct Python 3 solution for this coding contest problem.
AquaMoon had n strings of length m each. n is an odd number.
When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!
In her rage,... | instruction | 0 | 13,554 | 6 | 27,108 |
Tags: interactive, math
Correct Solution:
```
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
f = open('test.txt')
byt = f.readlines()
for x in byt:
print(x)
print(byt)
'''
t = int(input())
while t > 0:
t -= 1
s = input().split()
n = int(s[0])
m = int(s[1])
#建立每列的字典的列表
a = []
for i in ... | output | 1 | 13,554 | 6 | 27,109 |
Provide tags and a correct Python 3 solution for this coding contest problem.
AquaMoon had n strings of length m each. n is an odd number.
When AquaMoon was gone, Cirno tried to pair these n strings together. After making (n-1)/(2) pairs, she found out that there was exactly one string without the pair!
In her rage,... | instruction | 0 | 13,555 | 6 | 27,110 |
Tags: interactive, math
Correct Solution:
```
from collections import Counter
for _ in range(int(input())):
n, m = map(int, input().split())
f = [];l = []
f1={};l1={}
for i in range(n):
f += [input()]
for j in range(n - 1):
l += [input()]
for i in range(m):
s="";t=""
... | output | 1 | 13,555 | 6 | 27,111 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The DNA sequence for every living creature in Berland can be represented as a non-empty line consisting of lowercase Latin letters. Berland scientists found out that all the creatures evolve by stages. During one stage exactly one symbol of ... | instruction | 0 | 13,687 | 6 | 27,374 |
Tags: dp
Correct Solution:
```
#!/usr/bin/env python3
import itertools
import collections
# Read input strings
s1 = input()
s2 = input()
# Read evolution rules, use a mapping from the 2 target characters to the source character
rules = collections.defaultdict(set)
n = int(input())
for i in range(n):
rule = input()... | output | 1 | 13,687 | 6 | 27,375 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can... | instruction | 0 | 14,198 | 6 | 28,396 |
Tags: implementation, strings
Correct Solution:
```
import re
al = re.compile(r'^1*23*$')
def getType(word):
if word.endswith("lios"): return 1
elif word.endswith("liala"): return -1
elif word.endswith("etr"): return 2
elif word.endswith("etra"): return -2
elif word.endswith("initis"):return 3
elif word.e... | output | 1 | 14,198 | 6 | 28,397 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can... | instruction | 0 | 14,199 | 6 | 28,398 |
Tags: implementation, strings
Correct Solution:
```
def f(a):
b=len(a)
if b>=4 and a[-4:]=='lios':
return [1,1]
if b>=5 and a[-5:]=='liala':
return [1,2]
if b>=3 and a[-3:]=='etr':
return [2,1]
if b>=4 and a[-4:]=='etra':
return [2,2]
if b>=6 and a[-6:]=='initis':... | output | 1 | 14,199 | 6 | 28,399 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can... | instruction | 0 | 14,200 | 6 | 28,400 |
Tags: implementation, strings
Correct Solution:
```
import re
t = input()
p = [r'([^ ]*lios )*([^ ]*etr)( [^ ]*initis)*',
r'([^ ]*liala )*([^ ]*etra)( [^ ]*inites)*',
r'[^ ]*(li(os|ala)|etra?|init[ie]s)']
print(['NO', 'YES'][any(re.fullmatch(q, t) for q in p)])
``` | output | 1 | 14,200 | 6 | 28,401 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can... | instruction | 0 | 14,201 | 6 | 28,402 |
Tags: implementation, strings
Correct Solution:
```
s, n, m, f = input().split(), False, False, False
def cc(w, me, fe):
global m, f
if w.endswith(me):
m = True
return True
elif w.endswith(fe):
f = True
return True
else:
return False
def ad(w): return cc(w, 'lios'... | output | 1 | 14,201 | 6 | 28,403 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can... | instruction | 0 | 14,202 | 6 | 28,404 |
Tags: implementation, strings
Correct Solution:
```
# from dust i have come dust i will be
#each should be of same gender
#adjective*-noun*1-verb*
a=list(map(str,input().split()))
t=[0]*len(a)
str=["lios","liala","etr","etra","initis","inites"]
if len(a)==1:
for i in range(6):
if a[0].endswith(str[i]):
... | output | 1 | 14,202 | 6 | 28,405 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can... | instruction | 0 | 14,203 | 6 | 28,406 |
Tags: implementation, strings
Correct Solution:
```
madj = "lios"
fadj = "liala"
mnoun = "etr"
fnoun = "etra"
mver = "initis"
fver = "inites"
def valid_word(word):
sz = len(word)
if word[sz-len(mver):] == mver:
return (0, "v")
if word[sz-len(mver):] == fver:
return (1, "v")
if word[sz-l... | output | 1 | 14,203 | 6 | 28,407 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can... | instruction | 0 | 14,204 | 6 | 28,408 |
Tags: implementation, strings
Correct Solution:
```
def method(a,key):
key_len = [ len(i) for i in key ]
data = []
for i in a:
temp = None
x,y,z = i[-key_len[0]::],i[-key_len[1]::],i[-key_len[2]::]
if x in key:
temp = key.index(x)
elif... | output | 1 | 14,204 | 6 | 28,409 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with friends, that's why all the language's grammar can... | instruction | 0 | 14,205 | 6 | 28,410 |
Tags: implementation, strings
Correct Solution:
```
import sys
def solve():
validendings = ["lios", "liala", "etr", "etra", "initis", "inites"]
s = input().split()
if len(s) == 1:
if endswith(s[0], validendings):
print("YES")
return
print("NO")
return
nou... | output | 1 | 14,205 | 6 | 28,411 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with fri... | instruction | 0 | 14,206 | 6 | 28,412 |
Yes | output | 1 | 14,206 | 6 | 28,413 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with fri... | instruction | 0 | 14,207 | 6 | 28,414 |
Yes | output | 1 | 14,207 | 6 | 28,415 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with fri... | instruction | 0 | 14,208 | 6 | 28,416 |
Yes | output | 1 | 14,208 | 6 | 28,417 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with fri... | instruction | 0 | 14,209 | 6 | 28,418 |
Yes | output | 1 | 14,209 | 6 | 28,419 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with fri... | instruction | 0 | 14,210 | 6 | 28,420 |
No | output | 1 | 14,210 | 6 | 28,421 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with fri... | instruction | 0 | 14,211 | 6 | 28,422 |
No | output | 1 | 14,211 | 6 | 28,423 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with fri... | instruction | 0 | 14,212 | 6 | 28,424 |
No | output | 1 | 14,212 | 6 | 28,425 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya got interested in grammar on his third year in school. He invented his own language called Petya's. Petya wanted to create a maximally simple language that would be enough to chat with fri... | instruction | 0 | 14,213 | 6 | 28,426 |
No | output | 1 | 14,213 | 6 | 28,427 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In this problem you will write a simple code generator for a 2D programming language derived from [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck).
The code in this language is a rectangular grid of characters '.' and 'X'. The code is c... | instruction | 0 | 14,740 | 6 | 29,480 |
Tags: constructive algorithms
Correct Solution:
```
# A +
# print(int(input()) % 2)
# B
# good = ['cool', 'great', 'not bad', '!']
# for i in range(10):
# print(i, flush=True)
# r = input().strip().lower()
# for g in good:
# if g in r:
# print('normal', flush=True)
# exit(0... | output | 1 | 14,740 | 6 | 29,481 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In this problem you will write a simple code generator for a 2D programming language derived from [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck).
The code in this language is a rectangular grid of characters '.' and 'X'. The code is c... | instruction | 0 | 14,741 | 6 | 29,482 |
Tags: constructive algorithms
Correct Solution:
```
import sys
s = input()
#f = open('out.txt', 'w')
f = sys.stdout
n = 0
d = '\x00'
for c in s:
n = ord(c) - ord(d)
#print(n, file=sys.stderr)
if (n < 0):
for i in range(-n):
if i % 2 == 0:
print('X....', file=f)
... | output | 1 | 14,741 | 6 | 29,483 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In this problem you will write a simple code generator for a 2D programming language derived from [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck).
The code in this language is a rectangular grid of characters '.' and 'X'. The code is c... | instruction | 0 | 14,742 | 6 | 29,484 |
Tags: constructive algorithms
Correct Solution:
```
s = [ord(x) for x in input()]
val = 0
add2 = '...\n.XX\nXXX'
sub1 = '...\n.X.'
for ch in s:
delta = ch - val + 1
if delta > 0:
if delta % 3 == 1:
print(add2)
print(sub1)
delta -= 1
elif delta % 3 == 2:
... | output | 1 | 14,742 | 6 | 29,485 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In this problem you will write a simple code generator for a 2D programming language derived from [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck).
The code in this language is a rectangular grid of characters '.' and 'X'. The code is c... | instruction | 0 | 14,743 | 6 | 29,486 |
Tags: constructive algorithms
Correct Solution:
```
print(*['\n'.join([*['...\n.X.' for i in range(256 - x)], '.X.', *['...\n.X.' for i in range(x)]]) for x in map(ord, input())], sep='\n')
``` | output | 1 | 14,743 | 6 | 29,487 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In this problem you will write a simple code generator for a 2D programming language derived from [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck).
The code in this language is a rectangular grid of characters '.' and 'X'. The code is c... | instruction | 0 | 14,744 | 6 | 29,488 |
Tags: constructive algorithms
Correct Solution:
```
# python3
import math
WIDTH = 170
def add(n):
if n == 1:
add(2)
add(255)
else:
while n:
k = min(n, WIDTH - 1)
n -= k
print('.' * WIDTH)
print('X' * (k - 1) + '.' * (WIDTH - k) + 'X')
... | output | 1 | 14,744 | 6 | 29,489 |
Provide tags and a correct Python 3 solution for this coding contest problem.
In this problem you will write a simple code generator for a 2D programming language derived from [Brainfuck](https://en.wikipedia.org/wiki/Brainfuck).
The code in this language is a rectangular grid of characters '.' and 'X'. The code is c... | instruction | 0 | 14,745 | 6 | 29,490 |
Tags: constructive algorithms
Correct Solution:
```
s = input()
for c in s:
for i in range(256 - ord(c)):
print("...\n.X.")
print(".X.")
for i in range(ord(c)):
print("...\n.X.")
``` | output | 1 | 14,745 | 6 | 29,491 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.