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. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one can find the solution of the problem of discrete...
instruction
0
88,103
6
176,206
Tags: constructive algorithms, implementation, strings Correct Solution: ``` #找出bug n = int(input()) src, tar = input(), input() ans = [] def shift(s, x): ans.append(x) return s[-x:][::-1] + s[:-x] flag = True for i in range(n): index = -1 for j in range(n-i): if src[j] == tar[i]: ...
output
1
88,103
6
176,207
Provide tags and a correct Python 3 solution for this coding contest problem. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one can find the solution of the problem of discrete...
instruction
0
88,104
6
176,208
Tags: constructive algorithms, implementation, strings Correct Solution: ``` n, s, t = int(input()), input(), input() ans = [] for i in range(n): cur = 0 for j in range(n - i): if s[j] == t[i]: cur = j break else: print(-1) raise SystemExit ans.extend([n -...
output
1
88,104
6
176,209
Provide tags and a correct Python 3 solution for this coding contest problem. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one can find the solution of the problem of discrete...
instruction
0
88,105
6
176,210
Tags: constructive algorithms, implementation, strings Correct Solution: ``` n = int(input()) s = input() t = input() s0 = sorted(list(s)) t0 = sorted(list(t)) if s0 != t0 : print(-1) else: ans = [] for i in range(n): j = 0 while (s[j] != t[i]): j = j + 1 ans += [n - j - ...
output
1
88,105
6
176,211
Provide tags and a correct Python 3 solution for this coding contest problem. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one can find the solution of the problem of discrete...
instruction
0
88,106
6
176,212
Tags: constructive algorithms, implementation, strings Correct Solution: ``` n = int(input()) src, tar = input(), input() ans = [] def shift(s, x): ans.append(x) return s[-x:][::-1] + s[:-x] flag = True for i in range(n): index = -1 for j in range(n-i): if src[j] == tar[i]: index =...
output
1
88,106
6
176,213
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one c...
instruction
0
88,107
6
176,214
Yes
output
1
88,107
6
176,215
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one c...
instruction
0
88,108
6
176,216
Yes
output
1
88,108
6
176,217
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one c...
instruction
0
88,109
6
176,218
Yes
output
1
88,109
6
176,219
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one c...
instruction
0
88,110
6
176,220
Yes
output
1
88,110
6
176,221
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one c...
instruction
0
88,111
6
176,222
No
output
1
88,111
6
176,223
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one c...
instruction
0
88,112
6
176,224
No
output
1
88,112
6
176,225
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one c...
instruction
0
88,113
6
176,226
No
output
1
88,113
6
176,227
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Welcome to another task about breaking the code lock! Explorers Whitfield and Martin came across an unusual safe, inside of which, according to rumors, there are untold riches, among which one c...
instruction
0
88,114
6
176,228
No
output
1
88,114
6
176,229
Provide tags and a correct Python 3 solution for this coding contest problem. We just discovered a new data structure in our research group: a suffix three! It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in....
instruction
0
88,495
6
176,990
Tags: implementation Correct Solution: ``` x=int(input()) for i in range(x): st=input() # print(st[-2:]) if "po" in st[-2:] : print("FILIPINO") elif "desu" in st[-5:] or "masu" in st[-5:] : print("JAPANESE") else: print("KOREAN") ```
output
1
88,495
6
176,991
Provide tags and a correct Python 3 solution for this coding contest problem. We just discovered a new data structure in our research group: a suffix three! It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in....
instruction
0
88,496
6
176,992
Tags: implementation Correct Solution: ``` n = int(input()) i = 0 string1 = '' while i<n: string1= string1+ input() i= i+1 if n-i>=1: string1= string1+ ' ' list1= string1.split(' ') for n in range(len(list1)): if list1[n].endswith('po'): print('FILIPINO') elif list1[n].endswith('desu...
output
1
88,496
6
176,993
Provide tags and a correct Python 3 solution for this coding contest problem. We just discovered a new data structure in our research group: a suffix three! It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in....
instruction
0
88,497
6
176,994
Tags: implementation Correct Solution: ``` t=int(input()) while t!=0: t-=1 s=input() if s[-2:]=="po": print("FILIPINO") elif s[-4:]=="desu" or s[-4:]=="masu": print("JAPANESE") else: print("KOREAN") ```
output
1
88,497
6
176,995
Provide tags and a correct Python 3 solution for this coding contest problem. We just discovered a new data structure in our research group: a suffix three! It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in....
instruction
0
88,498
6
176,996
Tags: implementation Correct Solution: ``` def main(): N = int(input()) for _ in range(N): S = str(input()) if S.endswith("po"): print("FILIPINO") elif S.endswith("desu") or S.endswith("masu"): print("JAPANESE") else: print("KOREAN") if __name...
output
1
88,498
6
176,997
Provide tags and a correct Python 3 solution for this coding contest problem. We just discovered a new data structure in our research group: a suffix three! It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in....
instruction
0
88,499
6
176,998
Tags: implementation Correct Solution: ``` for i in range(int(input())): n = input() if "po" == n[-2:]: print("FILIPINO") elif "desu" == n[-4:] or "masu" == n[-4:]: print("JAPANESE") #elif "mnid" == n[-4:]: else: print("KOREAN") ```
output
1
88,499
6
176,999
Provide tags and a correct Python 3 solution for this coding contest problem. We just discovered a new data structure in our research group: a suffix three! It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in....
instruction
0
88,500
6
177,000
Tags: implementation Correct Solution: ``` n=int(input()) for i in range(1,n+1): str=input() if str[-5:]=="mnida": print("KOREAN") elif str[-4:]=="desu" or str[-4:]=="masu": print("JAPANESE") else: print("FILIPINO") ```
output
1
88,500
6
177,001
Provide tags and a correct Python 3 solution for this coding contest problem. We just discovered a new data structure in our research group: a suffix three! It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in....
instruction
0
88,501
6
177,002
Tags: implementation Correct Solution: ``` t=int(input()) for q in range(t): a=list(input()) if(a[len(a)-1]=='o'): print("FILIPINO") if(a[len(a)-1]=='u'): print("JAPANESE") if(a[len(a)-1]=='a'): print("KOREAN") ```
output
1
88,501
6
177,003
Provide tags and a correct Python 3 solution for this coding contest problem. We just discovered a new data structure in our research group: a suffix three! It's very useful for natural language processing. Given three languages and three suffixes, a suffix three can determine which language a sentence is written in....
instruction
0
88,502
6
177,004
Tags: implementation Correct Solution: ``` for _ in range(int(input())): s=input() if s[-2:]=='po': print("FILIPINO") elif s[-4:]=='masu' or s[-4:]=='desu': print("JAPANESE") else: print("KOREAN") ```
output
1
88,502
6
177,005
Provide tags and a correct Python 3 solution for this coding contest problem. One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Alex asks ...
instruction
0
90,626
6
181,252
Tags: implementation, strings Correct Solution: ``` s = input() # print(s) l = ["Danil", "Olya", "Slava", "Ann", "Nikita"] cnt = 0 for n in l: cnt = cnt + s.count(n) if cnt == 1: print("YES") else: print("NO") ```
output
1
90,626
6
181,253
Provide tags and a correct Python 3 solution for this coding contest problem. One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Alex asks ...
instruction
0
90,627
6
181,254
Tags: implementation, strings Correct Solution: ``` inp = input() names = ["Danil", "Olya", "Slava", "Ann", "Nikita"] rs = 0 for name in names: rs += inp.count(name) print("YES" if rs == 1 else "NO") ```
output
1
90,627
6
181,255
Provide tags and a correct Python 3 solution for this coding contest problem. One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Alex asks ...
instruction
0
90,628
6
181,256
Tags: implementation, strings Correct Solution: ``` str = input() FRIENDS = ["Danil", "Olya", "Slava", "Ann", "Nikita"] sum = 0 for name in FRIENDS: sum += str.count(name) if sum == 1: print('YES') else: print('NO') ```
output
1
90,628
6
181,257
Provide tags and a correct Python 3 solution for this coding contest problem. One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Alex asks ...
instruction
0
90,629
6
181,258
Tags: implementation, strings Correct Solution: ``` ls=["Danil","Olya","Slava","Ann","Nikita"] s=input() ctr=0 for a in ls: ctr+=s.count(a) if ctr==1: print("YES") else: print("NO") ```
output
1
90,629
6
181,259
Provide tags and a correct Python 3 solution for this coding contest problem. One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Alex asks ...
instruction
0
90,630
6
181,260
Tags: implementation, strings Correct Solution: ``` from sys import stdin, stdout s = stdin.readline().strip() challengers = ['Danil', 'Olya', 'Slava', 'Ann', 'Nikita'] n = len(s) cnt = 0 s += '#' * 50 for i in range(n): for f in challengers: if s[i: i + len(f)] == f: cnt += 1 if cnt == 1:...
output
1
90,630
6
181,261
Provide tags and a correct Python 3 solution for this coding contest problem. One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Alex asks ...
instruction
0
90,631
6
181,262
Tags: implementation, strings Correct Solution: ``` s = input() print('YES' if sum(s.count(n) for n in ["Danil", "Olya", "Slava", "Ann", "Nikita"]) == 1 else 'NO') ```
output
1
90,631
6
181,263
Provide tags and a correct Python 3 solution for this coding contest problem. One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Alex asks ...
instruction
0
90,632
6
181,264
Tags: implementation, strings Correct Solution: ``` s = input() lis = ["Danil", "Olya", "Slava", "Ann" , "Nikita"] r = sum([s.count(i) for i in lis]) print('NO YES'.split()[r==1]) ```
output
1
90,632
6
181,265
Provide tags and a correct Python 3 solution for this coding contest problem. One day Alex was creating a contest about his friends, but accidentally deleted it. Fortunately, all the problems were saved, but now he needs to find them among other problems. But there are too many problems, to do it manually. Alex asks ...
instruction
0
90,633
6
181,266
Tags: implementation, strings Correct Solution: ``` def get_ans(s, t): return s.count(t) s = input() a = get_ans(s, "Ann") + get_ans(s, "Danil") + get_ans(s, "Olya") + get_ans(s, "Slava") + get_ans(s, "Nikita") if a == 1: print("YES") else: print("NO") ```
output
1
90,633
6
181,267
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: * ...
instruction
0
91,218
6
182,436
Tags: implementation, strings Correct Solution: ``` z = input() res = '' if z.startswith('http'): res += 'http://' z = z[4:] elif z.startswith('ftp'): res += 'ftp://' z = z[3:] pi = z.rfind('ru') res += z[:pi] res += '.ru' if not z.endswith('ru'): res += '/'+z[pi+2:] print(res) ```
output
1
91,218
6
182,437
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: * ...
instruction
0
91,219
6
182,438
Tags: implementation, strings Correct Solution: ``` X = input() Result = "http://" if X[0] == "h" else "ftp://" Result += X[X.index("p") + 1:X.rfind("ru")] + ".ru/" Result += X[X.rfind("ru") + 2:] print(Result if Result[-1] != "/" else Result[:-1]) # UB_CodeForces # Advice: Falling down is an accident, staying down is...
output
1
91,219
6
182,439
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: * ...
instruction
0
91,220
6
182,440
Tags: implementation, strings Correct Solution: ``` string = input() if string.startswith('http'): protocol = string[:4] string = string[4:] else: protocol = string[:3] string = string[3:] domain_end = string.find('ru', 1) domain_name = string[:domain_end] context = string[domain_end + 2:] result = pr...
output
1
91,220
6
182,441
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: * ...
instruction
0
91,221
6
182,442
Tags: implementation, strings Correct Solution: ``` t = input() if t[0] == 'h': ans, t = 'http://', t[4:] else: ans, t = 'ftp://', t[3:] k = t.find('ru', 1) ans += t[:k] + '.ru' if len(t) > k + 2: ans += '/' + t[k + 2:] print(ans) ```
output
1
91,221
6
182,443
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: * ...
instruction
0
91,222
6
182,444
Tags: implementation, strings Correct Solution: ``` S = input() ans = "" ind = 0 if S[0] == 'f': ans += "ftp://" + S[3] ind = 4 else: ans += "http://" + S[4] ind = 5 while True: if S[ind:ind+2] == 'ru': ans += '.ru/' + S[ind + 2:] break ans += S[ind] ind += 1 if ans[-1...
output
1
91,222
6
182,445
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: * ...
instruction
0
91,223
6
182,446
Tags: implementation, strings Correct Solution: ``` s=input() ans="" if s[0]=='f': ans+='ftp://'+s[3] t=-1 for i in range(4,len(s)-1): if s[i]=='r' and s[i+1]=='u': t=i break ans+=s[4:t]+".ru" if len(s[t+2:])>0: ans+="/"+s[t+2:] print(ans) else: ...
output
1
91,223
6
182,447
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: * ...
instruction
0
91,224
6
182,448
Tags: implementation, strings Correct Solution: ``` a = input() r = '' flag = 0 flag2 = 0 for i in range(len(a)): r+=a[i] if r=='ftp': r+='://' elif r=='http': r+='://' elif a[i+1:i+3]=='ru' and flag==0: r+='.' flag = 1 if i==len(a)-3: flag2 = 1 ...
output
1
91,224
6
182,449
Provide tags and a correct Python 3 solution for this coding contest problem. Vasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource has format: <protocol>://<domain>.ru[/<context>] where: * ...
instruction
0
91,225
6
182,450
Tags: implementation, strings Correct Solution: ``` import re address = input() address = re.sub('(http|ftp)(\w+?)(ru)', r'\1://\2.\3', address) if re.match('.+?\.ru(\w+)', address): address = re.sub('\.ru(\w+)', r'.ru/\1', address) print(address) ```
output
1
91,225
6
182,451
Provide tags and a correct Python 3 solution for this coding contest problem. Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo b...
instruction
0
91,292
6
182,584
Tags: brute force, math, strings Correct Solution: ``` s = input() pos = len(s) + 1 print(26*(pos) - len(s)) ```
output
1
91,292
6
182,585
Provide tags and a correct Python 3 solution for this coding contest problem. Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo b...
instruction
0
91,293
6
182,586
Tags: brute force, math, strings Correct Solution: ``` s = input() l = [] li = ["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"] for c in li: for i in range(0, len(s)+2): str = s[0:i] + c + s[i:len(s)] if str in l: ...
output
1
91,293
6
182,587
Provide tags and a correct Python 3 solution for this coding contest problem. Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo b...
instruction
0
91,294
6
182,588
Tags: brute force, math, strings Correct Solution: ``` 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'] string = input() result = set() first = '' second = '' for i in range(len(string)): first = string[:i] second = string[...
output
1
91,294
6
182,589
Provide tags and a correct Python 3 solution for this coding contest problem. Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo b...
instruction
0
91,295
6
182,590
Tags: brute force, math, strings Correct Solution: ``` s=input() tedad = 26*(1+len(s))-len(s) print(tedad) ```
output
1
91,295
6
182,591
Provide tags and a correct Python 3 solution for this coding contest problem. Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo b...
instruction
0
91,296
6
182,592
Tags: brute force, math, strings Correct Solution: ``` s = input() d = set() for i in range(len(s)): for a in range(26): c = chr(ord('a') + a) d.add(s[:i] + c + s[i:]) for a in range(26): c = chr(ord('a') + a) d.add(s + c) print(len(d)) ```
output
1
91,296
6
182,593
Provide tags and a correct Python 3 solution for this coding contest problem. Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo b...
instruction
0
91,297
6
182,594
Tags: brute force, math, strings Correct Solution: ``` a=input() b=[0]*26 for i in range(len(a)): b[ord(a[i])-97]+=1 c=0 r=0 for i in range(26): if b[i]==0: c+=1 else: r+=(len(a)+1-b[i]) #print(r) r+=(c*(len(a)+1)) print(r) ```
output
1
91,297
6
182,595
Provide tags and a correct Python 3 solution for this coding contest problem. Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo b...
instruction
0
91,298
6
182,596
Tags: brute force, math, strings Correct Solution: ``` l = list(map(str, input())) aux = list(l) s = set() for i in range(len(l)+1): for j in range(97, 123): aux.insert(i, chr(j)) s.add(str(aux)) aux = list(l) print(len(s)) ```
output
1
91,298
6
182,597
Provide tags and a correct Python 3 solution for this coding contest problem. Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", and he has compiled them into a photo booklet with some photos in some order (possibly with some photos being duplicated). A photo b...
instruction
0
91,299
6
182,598
Tags: brute force, math, strings Correct Solution: ``` n=input() print(25*len(n)+26) ```
output
1
91,299
6
182,599
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,303
6
184,606
Tags: dp, greedy, implementation Correct Solution: ``` import math mas = ['a', 'e', 'i', 'o', 'u'] def check(ch): if ch in mas: return False else: return True s = input() i = 0 ans = '' j = 0 while i < len(s) - 2: if check(s[i]) and check(s[i+1]) and check(s[i+2]) and not (s[i] == s[i+1] an...
output
1
92,303
6
184,607
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,304
6
184,608
Tags: dp, greedy, implementation Correct Solution: ``` s=input() t="" n=len(s) ans=[] arr=['a','e','i','o','u'] if(n<3): print(s) else: i=0 while(i<n-2): p=[s[i],s[i+1],s[i+2]] # print(p) if(len(set(p))==1): ans.append(s[i]) i+=1 else: if(s[i] not in arr and s[i+1] not in arr an...
output
1
92,304
6
184,609
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,305
6
184,610
Tags: dp, greedy, implementation Correct Solution: ``` s=input() if len(s)<=2 or len(set(s))==1: print(s) exit() d={} for i in range(97,123): x=chr(i) if x in ['a','e','i','o','u']: d.update({x:False}) else: d.update({x:True}) l,i=[],0 while True: if i>=len(s)-2: break if d[s[i]]==True and d[s[i+1]]==Tru...
output
1
92,305
6
184,611
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,306
6
184,612
Tags: dp, greedy, implementation Correct Solution: ``` symbol = ["a", "e", "i", "o", "u"] a = input() i = 2 while i < len(a): if not (a[i] in symbol) and not(a[i - 1] in symbol) and not (a[i - 2] in symbol) and a[i - 2:i + 1] != a[i - 2] * 3: a = a[:i] + " " + a[i:] i = i + 3 else: i = i...
output
1
92,306
6
184,613
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,307
6
184,614
Tags: dp, greedy, implementation Correct Solution: ``` s=input() glas='aeiou' i=1 while i < len(s)-1: if s[i-1] not in glas and s[i] not in glas and s[i+1] not in glas: if s[i-1]!=s[i] or s[i]!=s[i+1] or s[i-1]!=s[i+1]: s=s[:i+1]+' '+s[i+1:] i+=3 continue i+=1 pri...
output
1
92,307
6
184,615
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,308
6
184,616
Tags: dp, greedy, implementation Correct Solution: ``` u = list(input()) n = len(u) a = set(['a', 'o', 'u', 'e', 'i']) p = 0 i = 2 while i < n: if u[i - 2] not in a and u[i - 1] not in a and u[i] not in a: if u[i - 2] != u[i - 1] or u[i - 1] != u[i] or u[i] != u[i - 2]: print(''.join(map(str, u[...
output
1
92,308
6
184,617