input stringlengths 1 8.57k | output stringlengths 2 5.65k |
|---|---|
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
There are N people. The name of the i-th person is S_i.
We would like to choose three people so that the following conditions are met:
* The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.
* There are no multiple... | "Correct Solution:
```
import itertools
n = int(input())
d = {'M': 0, 'A': 0, 'R': 0, 'C': 0, 'H': 0}
for i in range(n):
s = input()
if s[0] in d:
d[s[0]] += 1
ans = 0
for v in itertools.combinations(d, 3):
ans += d[v[0]] * d[v[1]] * d[v[2]]
print(ans)
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
There are N people. The name of the i-th person is S_i.
We would like to choose three people so that the following conditions are met:
* The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.
* There are no multiple... | "Correct Solution:
```
from itertools import*
x=sorted(s[0]for s in open(0).readlines()[1:])
#print(list(x))
c=[len(list(v))for k,v in groupby(x)if k in"MARCH"]
#print(c)
y=combinations(c,3)
#print(list(y))
print(sum(p*q*r for p,q,r in list(y)))
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
There are N people. The name of the i-th person is S_i.
We would like to choose three people so that the following conditions are met:
* The name of every chosen person begins with `M`, `A`, `R`, `C` or `H`.
* There are no multiple... | "Correct Solution:
```
import itertools
A = "MARCH"
c = {a: 0 for a in A}
N = int(input())
for _ in range(N):
S = input()
if S[0] in A:
c[S[0]] += 1
print(sum([c[cb[0]] * c[cb[1]] * c[cb[2]]
for cb in itertools.combinations(A, 3)]))
``` |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N people. The name of the i-th person is S_i.
We would like to choose three people so that the following conditions are met:
* The name of every chosen person begins... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N people. The name of the i-th person is S_i.
We would like to choose three people so that the following conditions are met:
* The name of every chosen person begins... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N people. The name of the i-th person is S_i.
We would like to choose three people so that the following conditions are met:
* The name of every chosen person begins... | No |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, after ">'" is followed by one or more "=", "#" comes, and... | "Correct Solution:
```
import re
A = ">'=+#=+~$"
B = ">\^(Q=)+~~$"
n = int(input())
for i in range(n):
s = input()
if re.match(A,s):
a, b = re.match(A,s).group().split("#")
print("A" if a.count("=") == b.count("=") else "NA")
elif re.match(B,s):
print("B")
else:
print... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, after ">'" is followed by one or more "=", "#" comes, and... | "Correct Solution:
```
n=int(input())
for times in range(n):
s=input()
ans="NA"
#A???????????§
if s[:2]==">'" and s[-1]=="~":
t=s[2:-1].split("#")
if len(t)==2 and len(t[0])>0:
valid=True
for v in t[0]:
if v!="=":
valid=False
break
if valid and t[0]==t[1]:
ans="A"
#B???????????§
... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, after ">'" is followed by one or more "=", "#" comes, and... | "Correct Solution:
```
def checkA(s):
l = len(s)
if l % 2 == 0:
return False
ll = (l-1)//2
for i in range(ll):
if s[i] != "=" or s[l-1-i] != "=":
return False
if s[ll] != "#":
return False
return True
def checkB(s):
l = len(s)
if l % 2 == 1:
... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, after ">'" is followed by one or more "=", "#" comes, and... | "Correct Solution:
```
for _ in [0]*int(input()):
s=input()
a='NA'
if s[:2]==">'" and s[-1]=='~' and '#' in s:
s=s[2:-1].split('#')
a=[a,'A'][set(s[0])==set(s[1])=={'='} and len(set(s))==1]
elif s[:2]=='>^' and s[-2:]=='~~':
s=s[2:-2]
a=['NA','B'][len(s)==2*s.count('Q=') ... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, after ">'" is followed by one or more "=", "#" comes, and... | "Correct Solution:
```
for _ in [0]*int(input()):
s=input()
if s[:2]==">'" and s[-1]=='~' and '#' in s:
s=s[2:-1].split('#')
print(['NA','A'][set(s[0])==set(s[1])=={'='} and len(set(s))==1])
elif s[:2]=='>^' and s[-2:]=='~~':
s=s[2:-2]
print(['NA','B'][len(s)==2*s.count('Q=')... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, after ">'" is followed by one or more "=", "#" comes, and... | "Correct Solution:
```
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0139
"""
import sys
from sys import stdin
import re
input = stdin.readline
def identify_snake(snake):
# ????????????>`???????¶???????1?????\?????????=]??????#??????????????§1?????\?????????=???????????????... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, after ">'" is followed by one or more "=", "#" comes, and... | "Correct Solution:
```
n = int(input())
for i in range(n):
s = input()
if s[:2] == ">'" and s[-1] == '~' and len(s) % 2 == 0 and '=#=' in s:
temp = ">'" + '=' * (s.count('=')//2) + '#' + '=' * (s.count('=')//2) + '~'
if s == temp:
print('A')
continue
elif s[:2] == ">^... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, after ">'" is followed by one or more "=", "#" comes, and... | "Correct Solution:
```
class Ex(Exception):
pass
n=int(input())
for i in range(n):
try:
snk=input()
l=len(snk)
head=snk[:2]
body=snk[2:l-1]
tail=snk[l-1]
if tail!='~' or snk[0]!='>':
print("NA")
continue
spl_a=body.split('#')
... |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, a... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, a... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, a... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, a... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, a... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, a... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, a... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In a world, a mysterious snake made of only letters lives. Two types of snakes are currently identified, type A and type B, but there may be other types as well.
For class A, a... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Xenia is an amateur programmer. Today on the IT lesson she learned about the Hamming distance.
The Hamming distance between two strings s = s1s2... sn and t = t1t2... tn of equ... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Xenia is an amateur programmer. Today on the IT lesson she learned about the Hamming distance.
The Hamming distance between two strings s = s1s2... sn and t = t1t2... tn of equ... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Xenia is an amateur programmer. Today on the IT lesson she learned about the Hamming distance.
The Hamming distance between two strings s = s1s2... sn and t = t1t2... tn of equ... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
zscoder wants to generate an input file for some programming competition problem.
His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he w... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
zscoder wants to generate an input file for some programming competition problem.
His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he w... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
zscoder wants to generate an input file for some programming competition problem.
His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he w... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
zscoder wants to generate an input file for some programming competition problem.
His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he w... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
zscoder wants to generate an input file for some programming competition problem.
His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he w... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
zscoder wants to generate an input file for some programming competition problem.
His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he w... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
zscoder wants to generate an input file for some programming competition problem.
His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he w... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
zscoder wants to generate an input file for some programming competition problem.
His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he w... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The smallest unit of data handled by a computer is called a bit, and the amount of information that represents multiple bits together is called a word. Currently, many computers... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The smallest unit of data handled by a computer is called a bit, and the amount of information that represents multiple bits together is called a word. Currently, many computers... | No |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is given in a line.
Output
Print the converted string in a... | "Correct Solution:
```
buff=input()
print(buff.swapcase())
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is given in a line.
Output
Print the converted string in a... | "Correct Solution:
```
target=input()
Ans=target.swapcase()
print(Ans)
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is given in a line.
Output
Print the converted string in a... | "Correct Solution:
```
name = str(input())
ans = str.swapcase(name)
print(ans)
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is given in a line.
Output
Print the converted string in a... | "Correct Solution:
```
sen=input()
sen=sen.swapcase()
print(sen)
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is given in a line.
Output
Print the converted string in a... | "Correct Solution:
```
str = input()
str = str.swapcase()
print(str)
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is given in a line.
Output
Print the converted string in a... | "Correct Solution:
```
x = input()
x = x.swapcase()
print(x)
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is given in a line.
Output
Print the converted string in a... | "Correct Solution:
```
S = input()
Sc = S.swapcase()
print(Sc)
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is given in a line.
Output
Print the converted string in a... | "Correct Solution:
```
str_row = input()
print(str_row.swapcase())
``` |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is g... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is g... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is g... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is g... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is g... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is g... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is g... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string.
Constraints
* The length of the input string < 1200
Input
A string is g... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Andrew, Fedor and Alex are inventive guys. Now they invent the game with strings for two players.
Given a group of n non-empty strings. During the game two players build the wo... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Andrew, Fedor and Alex are inventive guys. Now they invent the game with strings for two players.
Given a group of n non-empty strings. During the game two players build the wo... | No |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ 1000
* 1 ≤ Q ≤ 10000
* The input consists of alphabetica... | "Correct Solution:
```
base = 127
mask = (1 << 32) - 1
def calc_hash(lstr, pl, tl):
dl = tl - pl
tmp = set()
d = 1
for _ in range(pl):
d = (d * base) & mask
e = 0
for i in range(pl):
e = (e * base + lstr[i]) & mask
for i in range(dl):
tmp.add(e)
e = (e * bas... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ 1000
* 1 ≤ Q ≤ 10000
* The input consists of alphabetica... | "Correct Solution:
```
from collections import Counter
from math import floor, ceil, log
from heapq import heapreplace, heappush
import time
class TreeIndex:
CACHESIZE = 65535
class Node:
__slots__ = ('level', 'keys', 'values', 'keylen')
def __init__(self, level):
self.level = le... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ 1000
* 1 ≤ Q ≤ 10000
* The input consists of alphabetica... | "Correct Solution:
```
#!/usr/bin/env python3
import sys
def lms(t, i):
return i > 0 and not t[i-1] and t[i]
def induced_sort(s, k, t, lmss):
sa = [-1] * len(s)
cbin = [0]*k
for c in s:
cbin[c] += 1
ssum = 0
for i in range(k):
ssum += cbin[i]
cbin[i] = ssum
c... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ 1000
* 1 ≤ Q ≤ 10000
* The input consists of alphabetica... | "Correct Solution:
```
import sys
readline = sys.stdin.readline
base = 127
mask = (1 << 32) - 1
def calc_hash(f, pl, tl):
dl = tl - pl
tmp = set()
t = 1
for _ in range(pl):
t = (t * base) & mask
e = 0
for i in range(pl):
e = (e * base + f[i]) & mask
for i in range(dl):
... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ 1000
* 1 ≤ Q ≤ 10000
* The input consists of alphabetica... | "Correct Solution:
```
base = 127
mask = (1 << 32) - 1
def calc_hash(f, pl, tl):
dl = tl - pl
tmp = set()
t = 1
for _ in range(pl):
t = (t * base) & mask
e = 0
for i in range(pl):
e = (e * base + f[i]) & mask
for i in range(dl):
tmp.add(e)
e = (e * base - t... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ 1000
* 1 ≤ Q ≤ 10000
* The input consists of alphabetica... | "Correct Solution:
```
base = 127
mask = (1 << 32) - 1
def calc_hash(f, pl, tl):
dl = tl - pl
tmp = set()
t = 1
for _ in range(pl):
t = (t * base) & mask
e = 0
for i in range(pl):
e = (e * base + f[i]) & mask
for i in range(dl):
tmp.add(e)
e = (e * base - t * ... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ 1000
* 1 ≤ Q ≤ 10000
* The input consists of alphabetica... | "Correct Solution:
```
base = 127
mask = (1 << 32) - 1
def calc_hash(f, pl, tl):
dl = tl - pl
tmp = set()
t = 1
for _ in range(pl):
t = (t * base) & mask
e = 0
for i in range(pl):
e = (e * base + f[i]) & mask
for i in range(dl):
tmp.add(e)
e = (e * base - t * ... |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ 1000
* 1 ≤ Q ≤ 10000
* The input consists of alphabetica... | "Correct Solution:
```
base = 127
mask = (1 << 32) - 1
def calc_hash(f, pl, tl):
dl = tl - pl
tmp = set()
t = 1
for _ in range(pl):
t = (t * base) & mask
e = 0
for i in range(pl):
e = (e * base + f[i]) & mask
for i in range(dl):
tmp.add(e)
e = (e * base - t * ... |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ ... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ ... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ ... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ ... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ ... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ ... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ ... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Determine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.
Constraints
* 1 ≤ length of T ≤ 1000000
* 1 ≤ length of P_i ≤ ... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstra... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstra... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstra... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstra... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstra... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstra... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstra... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstra... | No |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.
The matches for the first k ... | "Correct Solution:
```
S = input()
print(["NO", "YES"][8 <= 15-len(S)+S.count("o")])
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.
The matches for the first k ... | "Correct Solution:
```
s = list(input())
win = s.count('x')
print('NO' if win >= 8 else 'YES')
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.
The matches for the first k ... | "Correct Solution:
```
S = input()
if 15 - S.count("x") >= 8:
print("YES")
else:
print("NO")
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.
The matches for the first k ... | "Correct Solution:
```
S = input()
if S.count('x') <= 7:
print("YES")
else:
print("NO")
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.
The matches for the first k ... | "Correct Solution:
```
S = input()
ans = 'NO' if S.count('x')>=8 else 'YES'
print(ans)
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.
The matches for the first k ... | "Correct Solution:
```
if str(input()).count("x") <= 7:
print("YES")
else:
print("NO")
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.
The matches for the first k ... | "Correct Solution:
```
S = input()
print('YES' if 15 - len(S) + S.count('o') >= 8 else 'NO')
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament.
The matches for the first k ... | "Correct Solution:
```
#23 M-SOLUTIONS
s=input()
x=s.count("x")
print("YES" if x<=7 else "NO")
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of lower-case letters
Input
In the first line, the text $s$ ... | "Correct Solution:
```
s = input()
p = input()
s = s + s
print('Yes' if p in s else 'No')
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of lower-case letters
Input
In the first line, the text $s$ ... | "Correct Solution:
```
s = input()
p = input()
s *= 2
if s.count(p):
print('Yes')
else:
print('No')
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of lower-case letters
Input
In the first line, the text $s$ ... | "Correct Solution:
```
s=input()
p=input()
w=(s+s)
if p in w:
print('Yes')
else:
print('No')
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of lower-case letters
Input
In the first line, the text $s$ ... | "Correct Solution:
```
s=input()
p=input()
s=s+s
a=s.find(p)
if a==-1:
print('No')
else:
print('Yes')
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of lower-case letters
Input
In the first line, the text $s$ ... | "Correct Solution:
```
word = input()*2
p = input()
if p in word:
print('Yes')
else:
print('No')
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of lower-case letters
Input
In the first line, the text $s$ ... | "Correct Solution:
```
s,p=input()*2,input()
print(['No','Yes'][p in s])
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of lower-case letters
Input
In the first line, the text $s$ ... | "Correct Solution:
```
s = input()
f = input()
s = s + s
if f in s:
print("Yes")
else:
print("No")
``` |
### Instruction:
Provide a correct Python 3 solution for this coding contest problem.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of lower-case letters
Input
In the first line, the text $s$ ... | "Correct Solution:
```
S = input()
P = input()
SS = S + S
print('Yes') if SS.count(P) > 0 else print('No')
``` |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of low... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of low... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of low... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of low... | Yes |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of low... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of low... | No |
### Instruction:
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which finds a pattern $p$ in a ring shaped text $s$.
<image>
Constraints
* $1 \leq $ length of $p \leq $ length of $s \leq 100$
* $s$ and $p$ consists of low... | No |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.