message stringlengths 2 23.8k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 97 109k | cluster float64 0 0 | __index_level_0__ int64 194 217k |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vus the Cossack has two binary strings, that is, strings that consist only of "0" and "1". We call these strings a and b. It is known that |b| β€ |a|, that is, the length of b is at most the leng... | instruction | 0 | 79,999 | 0 | 159,998 |
No | output | 1 | 79,999 | 0 | 159,999 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vus the Cossack has two binary strings, that is, strings that consist only of "0" and "1". We call these strings a and b. It is known that |b| β€ |a|, that is, the length of b is at most the leng... | instruction | 0 | 80,000 | 0 | 160,000 |
No | output | 1 | 80,000 | 0 | 160,001 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vus the Cossack has two binary strings, that is, strings that consist only of "0" and "1". We call these strings a and b. It is known that |b| β€ |a|, that is, the length of b is at most the leng... | instruction | 0 | 80,001 | 0 | 160,002 |
No | output | 1 | 80,001 | 0 | 160,003 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Vus the Cossack has two binary strings, that is, strings that consist only of "0" and "1". We call these strings a and b. It is known that |b| β€ |a|, that is, the length of b is at most the leng... | instruction | 0 | 80,002 | 0 | 160,004 |
No | output | 1 | 80,002 | 0 | 160,005 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
You are given two strings s and t of the same le... | instruction | 0 | 80,918 | 0 | 161,836 |
Tags: constructive algorithms, greedy, strings
Correct Solution:
```
from collections import *
def go():
n,s,t=int(input()),input(),input()
if Counter(s)!=Counter(t): return -1
ans=0
for i in range(n):
k=0
for j in range(i,n):
while k<n and s[k] != t[j]: k += 1
if k == n: break
k += 1
ans = max(ans... | output | 1 | 80,918 | 0 | 161,837 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
You are given two strings s and t of the same le... | instruction | 0 | 80,919 | 0 | 161,838 |
Tags: constructive algorithms, greedy, strings
Correct Solution:
```
q = int(input())
for x in range(q):
n = int(input())
s = str(input())
t = str(input())
ss = sorted(s)
tt = sorted(t)
if ss != tt:
ans = -1
else:
ans = 1000000000
for i in range(n):
k =... | output | 1 | 80,919 | 0 | 161,839 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
You are given two strings s and t of the same le... | instruction | 0 | 80,920 | 0 | 161,840 |
Tags: constructive algorithms, greedy, strings
Correct Solution:
```
from collections import Counter
def cal(n,s,t):
if(Counter(s)!=Counter(t)):
return -1
ans=0
for i in range(n):
k=0
for j in range(i,n):
while k<n and s[k] != t[j]:
k+=1
if k==... | output | 1 | 80,920 | 0 | 161,841 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
You are given two strings s and t of the same le... | instruction | 0 | 80,921 | 0 | 161,842 |
Tags: constructive algorithms, greedy, strings
Correct Solution:
```
# your code goes here
t =int(input())
for h in range(t):
ans = 1000000000
n = int(input())
a = str(input())
b = str(input())
if sorted(a) != sorted(b):
ans = -1
else:
ans ... | output | 1 | 80,921 | 0 | 161,843 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
You are given two strings s and t of the same le... | instruction | 0 | 80,922 | 0 | 161,844 |
Tags: constructive algorithms, greedy, strings
Correct Solution:
```
from sys import stdin, stdout
def getminmove(s,t):
len1 = len(s)
len2 = len(t)
if len1 != len2:
return -1
sa = [0]*26
ta = [0]*26
for c in s:
#print(str(ord(c)-ord('a')))
sa[ord(c)-ord('a')] += 1
... | output | 1 | 80,922 | 0 | 161,845 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
Y... | instruction | 0 | 80,923 | 0 | 161,846 |
No | output | 1 | 80,923 | 0 | 161,847 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
Y... | instruction | 0 | 80,924 | 0 | 161,848 |
No | output | 1 | 80,924 | 0 | 161,849 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
Y... | instruction | 0 | 80,925 | 0 | 161,850 |
No | output | 1 | 80,925 | 0 | 161,851 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The problem was inspired by Pied Piper story. After a challenge from Hooli's compression competitor Nucleus, Richard pulled an all-nighter to invent a new approach to compression: middle-out.
Y... | instruction | 0 | 80,926 | 0 | 161,852 |
No | output | 1 | 80,926 | 0 | 161,853 |
Provide a correct Python 3 solution for this coding contest problem.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constraints
* 1 β€ N β€ 50
* 1 β€ K β€ N
* S is a string of lengt... | instruction | 0 | 81,490 | 0 | 162,980 |
"Correct Solution:
```
n,k=map(int,input().split())
s=input();s=list(s)
s[k-1]=s[k-1].lower()
print("".join(s))
``` | output | 1 | 81,490 | 0 | 162,981 |
Provide a correct Python 3 solution for this coding contest problem.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constraints
* 1 β€ N β€ 50
* 1 β€ K β€ N
* S is a string of lengt... | instruction | 0 | 81,491 | 0 | 162,982 |
"Correct Solution:
```
a,b=map(int,input().split())
l=list(input())
l[b-1]=l[b-1].lower()
print(''.join(l))
``` | output | 1 | 81,491 | 0 | 162,983 |
Provide a correct Python 3 solution for this coding contest problem.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constraints
* 1 β€ N β€ 50
* 1 β€ K β€ N
* S is a string of lengt... | instruction | 0 | 81,492 | 0 | 162,984 |
"Correct Solution:
```
_,k=input().split();s=input();k=int(k)-1
print(s[:k]+s[k].lower()+s[k+1:])
``` | output | 1 | 81,492 | 0 | 162,985 |
Provide a correct Python 3 solution for this coding contest problem.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constraints
* 1 β€ N β€ 50
* 1 β€ K β€ N
* S is a string of lengt... | instruction | 0 | 81,493 | 0 | 162,986 |
"Correct Solution:
```
N,K=map(int,input().split())
s=list(input())
s[K-1]=chr(ord(s[K-1])+32)
print("".join(s))
``` | output | 1 | 81,493 | 0 | 162,987 |
Provide a correct Python 3 solution for this coding contest problem.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constraints
* 1 β€ N β€ 50
* 1 β€ K β€ N
* S is a string of lengt... | instruction | 0 | 81,494 | 0 | 162,988 |
"Correct Solution:
```
n, k = map(int, input().split())
s = input()
t = s.lower()
print(s[:k-1]+t[k-1]+s[k:])
``` | output | 1 | 81,494 | 0 | 162,989 |
Provide a correct Python 3 solution for this coding contest problem.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constraints
* 1 β€ N β€ 50
* 1 β€ K β€ N
* S is a string of lengt... | instruction | 0 | 81,495 | 0 | 162,990 |
"Correct Solution:
```
N,K = map(int,input().split())
S = input()
S = S[:K-1] + S[K-1].lower() + S[K:]
print(S)
``` | output | 1 | 81,495 | 0 | 162,991 |
Provide a correct Python 3 solution for this coding contest problem.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constraints
* 1 β€ N β€ 50
* 1 β€ K β€ N
* S is a string of lengt... | instruction | 0 | 81,496 | 0 | 162,992 |
"Correct Solution:
```
N,K=map(int,input().split())
S=list(input())
S[K-1]=S[K-1].lower()
S="".join(S)
print(S)
``` | output | 1 | 81,496 | 0 | 162,993 |
Provide a correct Python 3 solution for this coding contest problem.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constraints
* 1 β€ N β€ 50
* 1 β€ K β€ N
* S is a string of lengt... | instruction | 0 | 81,497 | 0 | 162,994 |
"Correct Solution:
```
N, K=map(int,input().split())
S=str(input())
print(S[:K-1]+str.lower(S[K-1])+S[K:])
``` | output | 1 | 81,497 | 0 | 162,995 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.
Constr... | instruction | 0 | 81,502 | 0 | 163,004 |
No | output | 1 | 81,502 | 0 | 163,005 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.
For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to the two strings "He" and "llo... | instruction | 0 | 82,163 | 0 | 164,326 |
Tags: brute force, implementation, strings
Correct Solution:
```
n, p, q = [int(e) for e in input().split(' ')]
s = input()
solA = -1
solB = -1
for i in range(0, (n // p) + 1):
if (n - p*i) % q == 0:
solA = i
solB = (n - p*i) // q
break
if solA == -1:
print(-1)
else:
print(solA + ... | output | 1 | 82,163 | 0 | 164,327 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.
For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to the two strings "He" and "llo... | instruction | 0 | 82,164 | 0 | 164,328 |
Tags: brute force, implementation, strings
Correct Solution:
```
n,p,q = map(int,input().split())
s = input()
def problem6(n,p,q,s):
cont = 0
cont2 = 0
j = 0
while n>=0:
if n%p==0:
break
cont+=1
n -= q
if n<0:
print("-1")
return
... | output | 1 | 82,164 | 0 | 164,329 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.
For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to the two strings "He" and "llo... | instruction | 0 | 82,165 | 0 | 164,330 |
Tags: brute force, implementation, strings
Correct Solution:
```
n, p, q = list(map(int, input().split()))
s = input()
dp = [0] * (n + max(p, q) + 1)
dp[0] = 1
for i in range(n + 1):
if dp[i] == 0:
continue
dp[i + p] = 1
dp[i + q] = 1
if not dp[n]:
print('-1')
exit()
ans = []
while n:
... | output | 1 | 82,165 | 0 | 164,331 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.
For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to the two strings "He" and "llo... | instruction | 0 | 82,166 | 0 | 164,332 |
Tags: brute force, implementation, strings
Correct Solution:
```
n, p, q = map(int, input().split())
s = input()
for i in range(n + 1):
for j in range(n + 1):
if (i * p + j * q == n):
print(i + j)
for ii in range (i):
print(s[ii * p : (ii + 1) * p])
for jj... | output | 1 | 82,166 | 0 | 164,333 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.
For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to the two strings "He" and "llo... | instruction | 0 | 82,167 | 0 | 164,334 |
Tags: brute force, implementation, strings
Correct Solution:
```
import sys
n,p,q = map(int,sys.stdin.readline().split())
word = list(input())
sol = -1
for i in range(0,int(n/p)+1):
#print(i)
#print(f'sol={sol}')
for j in range(0,int(n/q)+1):
#print(j)
if((i*p+j*q)==n):
#print... | output | 1 | 82,167 | 0 | 164,335 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.
For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to the two strings "He" and "llo... | instruction | 0 | 82,168 | 0 | 164,336 |
Tags: brute force, implementation, strings
Correct Solution:
```
n, p, q = map(int, input().split())
X = []
while n > 0:
if n % p:
n -= q
X.append(q)
else:
X += [p] * (n // p)
break
if n < 0:
print(-1)
else:
print(len(X))
s, i = input(), 0
for x in X:
pr... | output | 1 | 82,168 | 0 | 164,337 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given the string s of length n and the numbers p, q. Split the string s to pieces of length p and q.
For example, the string "Hello" for p = 2, q = 3 can be split to the two strings "Hel" and "lo" or to the two strings "He" and "llo... | instruction | 0 | 82,169 | 0 | 164,338 |
Tags: brute force, implementation, strings
Correct Solution:
```
from math import sqrt
def main():
n,p,q = [int(v) for v in input().split()]
d = input()
data=[-1 for _ in range(n+102)]
parent = [-1 for _ in range(n+102)]
data[0]=1
for i in range(0, n+1):
if data[i]!=-1:
d... | output | 1 | 82,169 | 0 | 164,339 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowercase Latin letters, and it is allowed to change ... | instruction | 0 | 82,251 | 0 | 164,502 |
Tags: greedy, implementation, strings
Correct Solution:
```
s, k = input(), int(input())
print((max(k - len(set(s)), 0), "impossible")[len(s) < k])
``` | output | 1 | 82,251 | 0 | 164,503 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowercase Latin letters, and it is allowed to change ... | instruction | 0 | 82,252 | 0 | 164,504 |
Tags: greedy, implementation, strings
Correct Solution:
```
string = input()
k = int(input())
mas = list(string)
mas1 = []
for i in mas:
if i not in mas1:
mas1.append(i)
if k > len(string):
print('impossible')
elif len(mas1) <= k:
print(k - len(mas1))
else:
print('0')
``` | output | 1 | 82,252 | 0 | 164,505 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowercase Latin letters, and it is allowed to change ... | instruction | 0 | 82,253 | 0 | 164,506 |
Tags: greedy, implementation, strings
Correct Solution:
```
s, k = input(), int(input())
unique = len(set(s))
if k > len(s):
print("impossible")
else:
print(max(0, k - unique))
``` | output | 1 | 82,253 | 0 | 164,507 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowercase Latin letters, and it is allowed to change ... | instruction | 0 | 82,254 | 0 | 164,508 |
Tags: greedy, implementation, strings
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in ... | output | 1 | 82,254 | 0 | 164,509 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowercase Latin letters, and it is allowed to change ... | instruction | 0 | 82,255 | 0 | 164,510 |
Tags: greedy, implementation, strings
Correct Solution:
```
s = input()
n = int(input())
if n > len(s):
print("impossible")
else:
ls = list(s)
ss = set(ls)
x = (n - len(ss))
if x < 0:
print(0)
else:
print(x)
``` | output | 1 | 82,255 | 0 | 164,511 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowercase Latin letters, and it is allowed to change ... | instruction | 0 | 82,256 | 0 | 164,512 |
Tags: greedy, implementation, strings
Correct Solution:
```
s = input()
k = int(input())
if(k>len(s)):
print("impossible")
else:
sizeSet = len(set(s))
if(sizeSet>=k):
print(0)
else:
dif = k-len(set(s))
print(dif)
``` | output | 1 | 82,256 | 0 | 164,513 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowercase Latin letters, and it is allowed to change ... | instruction | 0 | 82,257 | 0 | 164,514 |
Tags: greedy, implementation, strings
Correct Solution:
```
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import string
a1 = list(string.ascii_lowercase)
a2 = []
sum = 0
s = input()
for _ in s:
if _ in a1 and _ not in a2:
sum += 1
a2.append(_)
k = int(input())
if len(s) < k:
print("impossibl... | output | 1 | 82,257 | 0 | 164,515 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowercase Latin letters, and it is allowed to change ... | instruction | 0 | 82,258 | 0 | 164,516 |
Tags: greedy, implementation, strings
Correct Solution:
```
s=input()
k=int(input())
x=len(set(s))
if len(s)<k:
print("impossible")
else:
print(max(k-x,0))
``` | output | 1 | 82,258 | 0 | 164,517 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowerc... | instruction | 0 | 82,260 | 0 | 164,520 |
Yes | output | 1 | 82,260 | 0 | 164,521 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowerc... | instruction | 0 | 82,261 | 0 | 164,522 |
Yes | output | 1 | 82,261 | 0 | 164,523 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowerc... | instruction | 0 | 82,262 | 0 | 164,524 |
Yes | output | 1 | 82,262 | 0 | 164,525 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowerc... | instruction | 0 | 82,263 | 0 | 164,526 |
No | output | 1 | 82,263 | 0 | 164,527 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Calculate the minimum number of characters you need to change in the string s, so that it contains at least k different letters, or print that it is impossible.
String s consists only of lowerc... | instruction | 0 | 82,264 | 0 | 164,528 |
No | output | 1 | 82,264 | 0 | 164,529 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Problem
Given the strings S and Q queries.
The i-th query (0 β€ i β€ Q-1) is given the closed interval [li, ri] and the string Mi. Output how many character strings Mi exist in the substring from... | instruction | 0 | 82,522 | 0 | 165,044 |
No | output | 1 | 82,522 | 0 | 165,045 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
The Little Elephant loves strings very much.
He has an array a from n strings, consisting of lowercase English letters. Let's number the elements of the array from 1 to n, then let's denote th... | instruction | 0 | 82,851 | 0 | 165,702 |
No | output | 1 | 82,851 | 0 | 165,703 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a string s of length n consisting of lowercase English letters.
For two given strings s and t, say S is the set of distinct characters of s and T is the set of distinct characters of t. The strings s and t are isomorphic if th... | instruction | 0 | 83,132 | 0 | 166,264 |
Tags: hashing, strings
Correct Solution:
```
def getIntList():
return list(map(int, input().split()))
def getTransIntList(n):
first=getIntList()
m=len(first)
result=[[0]*n for _ in range(m)]
for i in range(m):
result[i][0]=first[i]
for j in range(1, n):
curr=getIntList()
... | output | 1 | 83,132 | 0 | 166,265 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a string s of length n consisting of lowercase English letters.
For two given strings s and t, say S is the set of distinct characters of s and T is the set of distinct characters of t. The strings s and t are isomorphic if th... | instruction | 0 | 83,133 | 0 | 166,266 |
Tags: hashing, strings
Correct Solution:
```
def main():
import sys
input = sys.stdin.buffer.readline
N, M = map(int, input().split())
S = input().split()
S = S[0].decode()
B1 = [[0] * (N+1) for _ in range(26)]
#B2 = [[0] * (N+1) for _ in range(26)]
mod1 = 1000000007
#mod2 = 100000... | output | 1 | 83,133 | 0 | 166,267 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a string s of length n consisting of lowercase English letters.
For two given strings s and t, say S is the set of distinct characters of s and T is the set of distinct characters of t. The strings s and t are isomorphic if th... | instruction | 0 | 83,134 | 0 | 166,268 |
Tags: hashing, strings
Correct Solution:
```
import sys, time
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
MOD = 10 ** 9 + [7, 9, 21, 33][int(time.monotonic()) % 4]
BASE = 2
ALPHA = 26
n, m = map(int, input().split())
s = [ord(c) - 97 for c in input()]
h = [[0] * (n + 1) for _ in range(ALPHA)... | output | 1 | 83,134 | 0 | 166,269 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given a string s of length n consisting of lowercase English letters.
For two given strings s and t, say S is the set of distinct characters of s and T is the set of distinct characters of t. The strings s and t are isomorphic if th... | instruction | 0 | 83,135 | 0 | 166,270 |
Tags: hashing, strings
Correct Solution:
```
def getIntList():
return list(map(int, input().split()));
def getTransIntList(n):
first=getIntList();
m=len(first);
result=[[0]*n for _ in range(m)];
for i in range(m):
result[i][0]=first[i];
for j in range(1, n):
curr=getIntList();
... | output | 1 | 83,135 | 0 | 166,271 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string s of length n consisting of lowercase English letters.
For two given strings s and t, say S is the set of distinct characters of s and T is the set of distinct characters... | instruction | 0 | 83,136 | 0 | 166,272 |
No | output | 1 | 83,136 | 0 | 166,273 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a string s of length n consisting of lowercase English letters.
For two given strings s and t, say S is the set of distinct characters of s and T is the set of distinct characters... | instruction | 0 | 83,137 | 0 | 166,274 |
No | output | 1 | 83,137 | 0 | 166,275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.