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.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only with small English letters (i.e. with 26 letters f... | instruction | 0 | 92,309 | 6 | 184,618 |
Tags: dp, greedy, implementation
Correct Solution:
```
checking = input()
vowels = ["a","e","i","o","u"]
streak = []
new = ""
for i,letter in enumerate(checking):
# print(streak)
if letter not in vowels:
streak.append(letter)
else:
streak = []
if len(streak) == 3:
if streak.count... | output | 1 | 92,309 | 6 | 184,619 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only with small English letters (i.e. with 26 letters f... | instruction | 0 | 92,310 | 6 | 184,620 |
Tags: dp, greedy, implementation
Correct Solution:
```
a=str(input())
sgl="bcdfghjklmnpqrstvwxyz"
ans=""
for i in range(len(a)):
ans+=a[i]
if len(ans)>2:
if sgl.count(ans[-1]) and sgl.count(ans[-2]) and sgl.count(ans[-3]) and (ans[-1]!=ans[-2] or ans[-1]!=ans[-3]):
ans=ans[:-1]+" "+ ans[-1]
... | output | 1 | 92,310 | 6 | 184,621 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only wit... | instruction | 0 | 92,311 | 6 | 184,622 |
Yes | output | 1 | 92,311 | 6 | 184,623 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only wit... | instruction | 0 | 92,312 | 6 | 184,624 |
Yes | output | 1 | 92,312 | 6 | 184,625 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only wit... | instruction | 0 | 92,313 | 6 | 184,626 |
Yes | output | 1 | 92,313 | 6 | 184,627 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only wit... | instruction | 0 | 92,314 | 6 | 184,628 |
Yes | output | 1 | 92,314 | 6 | 184,629 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only wit... | instruction | 0 | 92,315 | 6 | 184,630 |
No | output | 1 | 92,315 | 6 | 184,631 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only wit... | instruction | 0 | 92,316 | 6 | 184,632 |
No | output | 1 | 92,316 | 6 | 184,633 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only wit... | instruction | 0 | 92,317 | 6 | 184,634 |
No | output | 1 | 92,317 | 6 | 184,635 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only wit... | instruction | 0 | 92,318 | 6 | 184,636 |
No | output | 1 | 92,318 | 6 | 184,637 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understandi... | instruction | 0 | 92,806 | 6 | 185,612 |
Tags: dsu, graphs, greedy, sortings, strings, trees, two pointers
Correct Solution:
```
def ok(a,b,n):
for i in range(n):
if(a[i]>b[i]):
return False
return True
MAX = 100001
parent = [0] * MAX
Rank = [0] * MAX
def find(x):
if parent[x] == x:
return x
else:
return... | output | 1 | 92,806 | 6 | 185,613 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understandi... | instruction | 0 | 92,807 | 6 | 185,614 |
Tags: dsu, graphs, greedy, sortings, strings, trees, two pointers
Correct Solution:
```
T=int(input())
for _ in range(T):
n=int(input())
a=input()
b=input()
flag=0
for i in range(n):
if (a[i]>b[i]):
flag=1
break
if (flag==1):
print(-1)
else:
G... | output | 1 | 92,807 | 6 | 185,615 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understandi... | instruction | 0 | 92,808 | 6 | 185,616 |
Tags: dsu, graphs, greedy, sortings, strings, trees, two pointers
Correct Solution:
```
def x():
n = int(input())
ans = 0
A = list(input())
B = list(input())
G = []
ver = set()
for i in range(n):
a = ord(A[i]) - ord('a')
b = ord(B[i]) - ord('a')
ver.add(a)
ve... | output | 1 | 92,808 | 6 | 185,617 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understandi... | instruction | 0 | 92,809 | 6 | 185,618 |
Tags: dsu, graphs, greedy, sortings, strings, trees, two pointers
Correct Solution:
```
def found(x):
global uf
temp = x
while uf[x] != x:
x = uf[x]
ans = x
while uf[temp] != temp:
parent = uf[temp]
uf[temp] = ans
temp = parent
return ans
inp = lambda : list(map(... | output | 1 | 92,809 | 6 | 185,619 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understandi... | instruction | 0 | 92,810 | 6 | 185,620 |
Tags: dsu, graphs, greedy, sortings, strings, trees, two pointers
Correct Solution:
```
import sys
import math
import heapq
import bisect
from collections import Counter
from collections import defaultdict
from io import BytesIO, IOBase
import string
class FastIO(IOBase):
newlines = 0
def __init__(self, file... | output | 1 | 92,810 | 6 | 185,621 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understandi... | instruction | 0 | 92,811 | 6 | 185,622 |
Tags: dsu, graphs, greedy, sortings, strings, trees, two pointers
Correct Solution:
```
t=int(input())
for j in range(t):
n=int(input())
a=input()
b=input()
# First constructing graph
gr=dict(list())
flag=0
for i in range(n):
if ord(a[i])>ord(b[i]):
flag=1
break
if gr.get(a[i],0)==0:
gr[a[i]]=[]
... | output | 1 | 92,811 | 6 | 185,623 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understandi... | instruction | 0 | 92,812 | 6 | 185,624 |
Tags: dsu, graphs, greedy, sortings, strings, trees, two pointers
Correct Solution:
```
import sys
input = sys.stdin.readline
for _ in range(int(input())):
n, a, b, ans = int(input()), [char for char in input().strip()], [char for char in input().strip()], 0
for i in range(n):
if a[i] > b[i]:
... | output | 1 | 92,812 | 6 | 185,625 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Note that the only difference between String Transformation 1 and String Transformation 2 is in the move Koa does. In this version the letter y Koa selects must be strictly greater alphabetically than x (read statement for better understandi... | instruction | 0 | 92,813 | 6 | 185,626 |
Tags: dsu, graphs, greedy, sortings, strings, trees, two pointers
Correct Solution:
```
for _ in range(int(input())):
n=int(input())
a=list(input())
b=list(input())
for i in range(n):
if a[i]>b[i]:
print(-1)
break
else:
s=sorted(list(set(a)|set(b)))
an... | output | 1 | 92,813 | 6 | 185,627 |
Provide tags and a correct Python 3 solution for this coding contest problem.
If you have ever interacted with a cat, you have probably noticed that they are quite particular about how to pet them. Here is an approximate map of a normal cat.
<image>
However, some cats won't tolerate this nonsense from the humans. He... | instruction | 0 | 93,216 | 6 | 186,432 |
Tags: brute force, interactive
Correct Solution:
```
G = {"no.":3, "eve":1, "are":1, "wor":1, "ter":1, "god":1, "now":2}
N = {"no.":5, "gre":1, "coo":1, "thi":1, "not":1, "tou":1}
from collections import defaultdict as dd, deque
C = dd(int)
S = set()
for i in range(10):
print(i)
s = input()+'........'
s =... | output | 1 | 93,216 | 6 | 186,433 |
Provide tags and a correct Python 3 solution for this coding contest problem.
If you have ever interacted with a cat, you have probably noticed that they are quite particular about how to pet them. Here is an approximate map of a normal cat.
<image>
However, some cats won't tolerate this nonsense from the humans. He... | instruction | 0 | 93,217 | 6 | 186,434 |
Tags: brute force, interactive
Correct Solution:
```
import sys
for i in range(10):
print(i)
sys.stdout.flush()
a = sys.stdin.readline().strip().lower()
if "cool" in a or "great" in a or "not bad" in a or "think" in a:
print("normal")
sys.exit(0)
if "die" in a or "serious" in a or "way" in a or "worse... | output | 1 | 93,217 | 6 | 186,435 |
Provide tags and a correct Python 3 solution for this coding contest problem.
If you have ever interacted with a cat, you have probably noticed that they are quite particular about how to pet them. Here is an approximate map of a normal cat.
<image>
However, some cats won't tolerate this nonsense from the humans. He... | instruction | 0 | 93,222 | 6 | 186,444 |
Tags: brute force, interactive
Correct Solution:
```
#print('grumpy')
from sys import exit
import sys
a = ['no', 'no', 'no', 'no', 'no', "don'",'grea',"don'",'not ','cool']
b = ['no','no','no', 'no w', 'no w','go d','wors','terr', "don'", 'are ']
for i in range(9):
sys.stdout.write(str(i))
sys.stdout.write('\n... | output | 1 | 93,222 | 6 | 186,445 |
Provide tags and a correct Python 3 solution for this coding contest problem.
If you have ever interacted with a cat, you have probably noticed that they are quite particular about how to pet them. Here is an approximate map of a normal cat.
<image>
However, some cats won't tolerate this nonsense from the humans. He... | instruction | 0 | 93,223 | 6 | 186,446 |
Tags: brute force, interactive
Correct Solution:
```
normal = ["no"] * 5 + ["cool", "not bad", "great!", "don't touch me!", "don't think so"]
grumpy = ["no"] * 3 + ["no way"] * 2 + ["terrible", "worse", "go die in a hole", "don't even", "are you serious?"]
import sys
import re
sys.stdout.flush()
normal = [re.sub("('|... | output | 1 | 93,223 | 6 | 186,447 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the ... | instruction | 0 | 94,078 | 6 | 188,156 |
Tags: implementation
Correct Solution:
```
x=input()
z=input().split()
mx=0
for i in z:
pres=0
for a in i:
if a>='A' and a<='Z':
pres+=1
if mx < pres:
mx=pres
print(mx)
``` | output | 1 | 94,078 | 6 | 188,157 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the ... | instruction | 0 | 94,079 | 6 | 188,158 |
Tags: implementation
Correct Solution:
```
n = int(input())
s = input().split(' ')
ans = 0
for words in s:
c = 0
for ch in words:
if (ch >= 'A' and ch <= 'Z'):
c += 1
ans = max(ans, c)
print(ans)
``` | output | 1 | 94,079 | 6 | 188,159 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the ... | instruction | 0 | 94,080 | 6 | 188,160 |
Tags: implementation
Correct Solution:
```
big_letters = ["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"]
max_n = 0
n = int(input())
a = input().split(" ")
for el in a:
n = 0
for i in el:
if i in big_letters:
... | output | 1 | 94,080 | 6 | 188,161 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the ... | instruction | 0 | 94,081 | 6 | 188,162 |
Tags: implementation
Correct Solution:
```
n = int(input())
text = input().split()
ans = 0
for word in text:
cur_ans = 0
for let in word:
if let >= "A" and let <= "Z":
cur_ans+=1
ans = max(ans,cur_ans)
print(ans)
``` | output | 1 | 94,081 | 6 | 188,163 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the ... | instruction | 0 | 94,082 | 6 | 188,164 |
Tags: implementation
Correct Solution:
```
"""
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the volume of the given text.
Inpu... | output | 1 | 94,082 | 6 | 188,165 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the ... | instruction | 0 | 94,083 | 6 | 188,166 |
Tags: implementation
Correct Solution:
```
n =int(input())
capital= ['A','B','C','D','E','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
linha= input().split()
sum_max=0
for palavra in linha:
s=0
for ch in palavra:
if ch in capital:
s+=1
i... | output | 1 | 94,083 | 6 | 188,167 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the ... | instruction | 0 | 94,084 | 6 | 188,168 |
Tags: implementation
Correct Solution:
```
n = input()
s = input()
res = 0
mx = 0
for i in s.split():
for j in i:
if j.isupper():
res += 1
mx = max(res, mx)
res = 0
print (mx)
``` | output | 1 | 94,084 | 6 | 188,169 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume of all words in the text.
Calculate the ... | instruction | 0 | 94,085 | 6 | 188,170 |
Tags: implementation
Correct Solution:
```
n=int(input())
x=list(input().split())
ma=0
for i in x:
ca=0
for a in i:
if 'A'<=a<='Z':
ca+=1
if ca>ma:
ma=ca
print(ma)
``` | output | 1 | 94,085 | 6 | 188,171 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character β non-empty string s, consisting of a lowercase Latin le... | instruction | 0 | 95,738 | 6 | 191,476 |
Tags: dp
Correct Solution:
```
from math import inf
from sys import stdin
input = stdin.readline
s,k = input().split()
n = len(s)
k = int(k)
ch = [[0]*26 for _ in range(26)]
for _ in range(int(input())):
a,b,c = input().split()
ch[ord(a)-97][ord(b)-97] = int(c)
dp = [[[-inf]*26 for _ in range(k+2)] for _ in r... | output | 1 | 95,738 | 6 | 191,477 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character β non-empty string s, consisting of a lowercase Latin le... | instruction | 0 | 95,739 | 6 | 191,478 |
Tags: dp
Correct Solution:
```
from math import inf
s,k= input().split()
k=int(k)
dict=[[0]*26 for i in range(26)]
for i in range(int(input())):
x=input().split()
# print(ord(x[0])-97,ord(x[1])-97)
dict[ord(x[0])-97][ord(x[1])-97]=int(x[2])
dp=[[[-inf]*26 for j in range(k+2)]for i in range(len(s))]
m=-1
f... | output | 1 | 95,739 | 6 | 191,479 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character β non-empty string s, consisting of a lowercase Latin le... | instruction | 0 | 95,740 | 6 | 191,480 |
Tags: dp
Correct Solution:
```
import string
s, k = input().split()
max_changes = int(k)
len_s = len(s)
alpha = string.ascii_lowercase
bonuses = { ch: { ch: 0 for ch in alpha } for ch in alpha }
for i in range(int(input())):
a, b, x = input().split()
bonuses[a][b] = int(x)
def improve(current, changed, a, b,... | output | 1 | 95,740 | 6 | 191,481 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character β non-empty string s, consisting of a lowercase Latin le... | instruction | 0 | 95,741 | 6 | 191,482 |
Tags: dp
Correct Solution:
```
# Legends Always Come Up with Solution
# Author: Manvir Singh
import os
import sys
from io import BytesIO, IOBase
from math import inf
def main():
s,k=input().split()
k=int(k)
a=[[0 for _ in range(26)] for _ in range(26)]
n=len(s)
for _ in range(int(input())):
... | output | 1 | 95,741 | 6 | 191,483 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character β non-empty string s, consisting of a lowercase Latin le... | instruction | 0 | 95,742 | 6 | 191,484 |
Tags: dp
Correct Solution:
```
import math
R = lambda: map(int, input().split())
s, k = input().split()
k = int(k)
g = [[0 for j in range(30)] for i in range(30)]
for i in range(int(input())):
f, t, sc = input().split()
f, t, sc = ord(f) - ord('a'), ord(t) - ord('a'), int(sc)
g[f][t] = sc
n = len(s)
dp = [... | output | 1 | 95,742 | 6 | 191,485 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character β non-emp... | instruction | 0 | 95,744 | 6 | 191,488 |
No | output | 1 | 95,744 | 6 | 191,489 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character β non-emp... | instruction | 0 | 95,745 | 6 | 191,490 |
No | output | 1 | 95,745 | 6 | 191,491 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vasya plays the LionAge II. He was bored of playing with a stupid computer, so he installed this popular MMORPG, to fight with his friends. Vasya came up with the name of his character β non-emp... | instruction | 0 | 95,746 | 6 | 191,492 |
No | output | 1 | 95,746 | 6 | 191,493 |
Provide tags and a correct Python 3 solution for this coding contest problem.
HQ9+ is a joke programming language which has only four one-character instructions:
* "H" prints "Hello, World!",
* "Q" prints the source code of the program itself,
* "9" prints the lyrics of "99 Bottles of Beer" song,
* "+" incre... | instruction | 0 | 96,260 | 6 | 192,520 |
Tags: implementation
Correct Solution:
```
command = input()
act = ['H', 'Q', '9']
x = 0
for el in command:
if el in act:
print('YES')
x = 1
break
if x == 0:
print('NO')
``` | output | 1 | 96,260 | 6 | 192,521 |
Provide tags and a correct Python 3 solution for this coding contest problem.
HQ9+ is a joke programming language which has only four one-character instructions:
* "H" prints "Hello, World!",
* "Q" prints the source code of the program itself,
* "9" prints the lyrics of "99 Bottles of Beer" song,
* "+" incre... | instruction | 0 | 96,262 | 6 | 192,524 |
Tags: implementation
Correct Solution:
```
#!/usr/local/bin/python3
string = input()
if ('H' in string) or ('Q' in string) or ('9' in string):
print("YES")
else:
print("NO")
``` | output | 1 | 96,262 | 6 | 192,525 |
Provide tags and a correct Python 3 solution for this coding contest problem.
HQ9+ is a joke programming language which has only four one-character instructions:
* "H" prints "Hello, World!",
* "Q" prints the source code of the program itself,
* "9" prints the lyrics of "99 Bottles of Beer" song,
* "+" incre... | instruction | 0 | 96,264 | 6 | 192,528 |
Tags: implementation
Correct Solution:
```
n=input()
if '9' in n or 'H' in n or 'Q' in n:
print('YES')
else:
print('NO')
``` | output | 1 | 96,264 | 6 | 192,529 |
Provide tags and a correct Python 3 solution for this coding contest problem.
HQ9+ is a joke programming language which has only four one-character instructions:
* "H" prints "Hello, World!",
* "Q" prints the source code of the program itself,
* "9" prints the lyrics of "99 Bottles of Beer" song,
* "+" incre... | instruction | 0 | 96,265 | 6 | 192,530 |
Tags: implementation
Correct Solution:
```
str=input("")
c=0
for i in str:
if i=='H' or i=='Q' or i=='9':
c+=1
if c>0:
print("YES")
else:
print("NO")
``` | output | 1 | 96,265 | 6 | 192,531 |
Provide tags and a correct Python 3 solution for this coding contest problem.
HQ9+ is a joke programming language which has only four one-character instructions:
* "H" prints "Hello, World!",
* "Q" prints the source code of the program itself,
* "9" prints the lyrics of "99 Bottles of Beer" song,
* "+" incre... | instruction | 0 | 96,266 | 6 | 192,532 |
Tags: implementation
Correct Solution:
```
print('YES' if set('HQ9') & set(input()) else 'NO')
``` | output | 1 | 96,266 | 6 | 192,533 |
Provide tags and a correct Python 3 solution for this coding contest problem.
HQ9+ is a joke programming language which has only four one-character instructions:
* "H" prints "Hello, World!",
* "Q" prints the source code of the program itself,
* "9" prints the lyrics of "99 Bottles of Beer" song,
* "+" incre... | instruction | 0 | 96,267 | 6 | 192,534 |
Tags: implementation
Correct Solution:
```
x= input()
y=True
for i in range (len(x)):
if x[i] in "HQ9":
print("YES")
y= False
break
if y:
print("NO")
``` | output | 1 | 96,267 | 6 | 192,535 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each file name has a fo... | instruction | 0 | 96,372 | 6 | 192,744 |
Tags: dp, greedy, implementation
Correct Solution:
```
s = input()
a = []
for i, c in enumerate(s):
if c == '.':
a.append(i)
n = len(s)
if not a or not 1 <= a[0] <= 8 or not 1 <= n - a[-1] - 1 <= 3:
print('NO')
elif not all(2 <= abs(y - x - 1) <= 11 for x, y in zip(a, a[1:])):
print('NO')
else:
... | output | 1 | 96,372 | 6 | 192,745 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each file name has a fo... | instruction | 0 | 96,373 | 6 | 192,746 |
Tags: dp, greedy, implementation
Correct Solution:
```
s = input()
words = s.split('.')
n = s.count('.')
numberOfWordsWithSizeLessThanTwo = len([x for x in words[1:-1] if len(x) < 2])
numberOfWordsWithSizeMoreThanEleven = len([x for x in words[1:-1] if len(x) > 11])
if len(words) == 1:
print('NO')
elif len(word... | output | 1 | 96,373 | 6 | 192,747 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each file name has a fo... | instruction | 0 | 96,374 | 6 | 192,748 |
Tags: dp, greedy, implementation
Correct Solution:
```
s = input()
v = s.split(sep='.')
flen = len(v[0])
llen = len(v[-1])
#print(v)
if len(v) < 2 :
print('NO')
elif not (flen >= 1 and flen <= 8) :
print('NO')
elif not (llen >= 1 and llen <= 3) :
print('NO')
else :
for i in v[1:-1] :
... | output | 1 | 96,374 | 6 | 192,749 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each file name has a fo... | instruction | 0 | 96,375 | 6 | 192,750 |
Tags: dp, greedy, implementation
Correct Solution:
```
s = input()
v = s.split(sep='.')
flen = len(v[0])
llen = len(v[-1])
if len(v) < 2 :
print('NO')
elif not (flen >= 1 and flen <= 8) :
print('NO')
elif not (llen >= 1 and llen <= 3) :
print('NO')
else :
for i in v[1:-1] :
... | output | 1 | 96,375 | 6 | 192,751 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each file name has a fo... | instruction | 0 | 96,376 | 6 | 192,752 |
Tags: dp, greedy, implementation
Correct Solution:
```
s = input()
if s[0] == "." or s[-1] == ".":
print("NO")
quit()
s = s.split(".")
if len(s) == 1:
print("NO")
quit()
if not 1 <= len(s[-1]) <= 3 or not 1 <= len(s[0]) <= 8:
print("NO")
quit()
arr = [s[-1]]
s.pop()
n = len(s)
for i in range(n -... | output | 1 | 96,376 | 6 | 192,753 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each file name has a fo... | instruction | 0 | 96,377 | 6 | 192,754 |
Tags: dp, greedy, implementation
Correct Solution:
```
import sys
def solve():
a = input().split('.')
if len(a) < 2:
print("NO")
return
res = [[""] * 2 for _ in range(len(a) - 1)]
res[0][0] = a[0]
res[len(res) - 1][1] = a[-1]
for i in range(1, len(a) - 1):
if len(a[i]) <... | output | 1 | 96,377 | 6 | 192,755 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.