message stringlengths 2 59.7k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 37 108k | cluster float64 20 20 | __index_level_0__ int64 74 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to win Tanya's heart he has.
Unfortunately, Igor ... | instruction | 0 | 79,452 | 20 | 158,904 |
Tags: data structures, dp, greedy, implementation
Correct Solution:
```
"""
for _ in range(int(input())):
n,m = map(int,input().split())
l=[]
ans=0
for i in range(n):
s = input()
l.append(s)
# print(l)
for i in range(n):
for j in range(m):
if l[i][j]=="C":
... | output | 1 | 79,452 | 20 | 158,905 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to win Tanya's heart he has.
Unfortunately, Igor ... | instruction | 0 | 79,453 | 20 | 158,906 |
Tags: data structures, dp, greedy, implementation
Correct Solution:
```
v = int(input())
a = list(map(int, input().split()))
m = min(a)
if v < m:
print(-1)
else:
a = [0] + a
d = [0] * 10
k = 9 - a[::-1].index(m)
n = v // m
d[k] = n
v -= n * m
for i in range(0, n):
for j in range(... | output | 1 | 79,453 | 20 | 158,907 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to win Tanya's heart he has.
Unfortunately, Igor ... | instruction | 0 | 79,454 | 20 | 158,908 |
Tags: data structures, dp, greedy, implementation
Correct Solution:
```
n = int(input())
l = list(map(int,input().split()))
c = 0
x = len(l)
w = ""
zzz = 0
q = 0
mi = min(l)
q = l.index(min(l))
if n//min(l) == 0:
print(-1)
else:
l1 = [0]*(n//min(l))
aa = n//mi - 1
cc = 0
for i in range(len(l1)):
... | output | 1 | 79,454 | 20 | 158,909 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to win Tanya's heart he has.
Unfortunately, Igor ... | instruction | 0 | 79,455 | 20 | 158,910 |
Tags: data structures, dp, greedy, implementation
Correct Solution:
```
if __name__=='__main__':
n = (int)(input())
l = list(map(int, input().split()))
m = min(l)
if n<m:
print("-1")
elif n%m == 0:
s = -1
for i in range(8,-1,-1):
if l[i] == m:
s = ... | output | 1 | 79,455 | 20 | 158,911 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to win Tanya's heart he has.
Unfortunately, Igor ... | instruction | 0 | 79,456 | 20 | 158,912 |
Tags: data structures, dp, greedy, implementation
Correct Solution:
```
n = int(input())
lis=list(map(int,input().split()))
aa=lis.index(min(lis))+1
a = min(lis)
no = list(str(aa)*(n//a))
if len(no)==0:
print(-1)
exit()
dig = n//a
n-=(dig*a)
#print(dig,no,n,a,aa)
for i in range(dig):
ss=0
for j in range... | output | 1 | 79,456 | 20 | 158,913 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to win Tanya's heart he has.
Unfortunately, Igor ... | instruction | 0 | 79,457 | 20 | 158,914 |
Tags: data structures, dp, greedy, implementation
Correct Solution:
```
# Author : nitish420 --------------------------------------------------------------------
import os
import sys
from io import BytesIO, IOBase
mod=10**9+7
# sys.setrecursionlimit(10**6)
from math import inf
def main():
w=int(input())
a=li... | output | 1 | 79,457 | 20 | 158,915 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to w... | instruction | 0 | 79,464 | 20 | 158,928 |
No | output | 1 | 79,464 | 20 | 158,929 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger the number is, the more chance to w... | instruction | 0 | 79,465 | 20 | 158,930 |
No | output | 1 | 79,465 | 20 | 158,931 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the... | instruction | 0 | 79,620 | 20 | 159,240 |
Tags: *special, implementation, math
Correct Solution:
```
number = input()
drop = False
d8 = False
dropIndex = 0
for i in range(1,len(number)):
if number[i]=='9' and d8 == False:
dropIndex = i
if number[i]>='0' and number[i]<='7':
drop = True
break
if number[i]=='8' and d8 == True:... | output | 1 | 79,620 | 20 | 159,241 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the... | instruction | 0 | 79,621 | 20 | 159,242 |
Tags: *special, implementation, math
Correct Solution:
```
def get(s):
ans = 0
for i in s:
ans += (ord(i) - ord('0'))
return ans
def solve1():
x = input()
n = len(x)
best_ans = x
best_val = get(x)
ans = str('' if int(x[0]) - 1 == 0 else int(x[0]) - 1) + '9' * (n - 1)
if get... | output | 1 | 79,621 | 20 | 159,243 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the... | instruction | 0 | 79,622 | 20 | 159,244 |
Tags: *special, implementation, math
Correct Solution:
```
x = input()
xlen = len(x) - 1
x0 = x[0]
x00 = str(int(x0) - 1)
sum = int(x00) + 9*xlen
if x00 == '0':
x00 = ''
ans = x00 + '9'*xlen
if int(x0 + '9'*xlen) <= int(x):
ans = int(x0 + '9'*xlen)
print(ans)
else:
for i in range(xlen, 0, -1):
a... | output | 1 | 79,622 | 20 | 159,245 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the... | instruction | 0 | 79,623 | 20 | 159,246 |
Tags: *special, implementation, math
Correct Solution:
```
s = input()
a = list(map(int, s))
ans = a
for i in range(len(a) - 1, -1, -1):
b = a.copy()
if b[i] != 0:
b[i] = int(a[i]) - 1
b[i + 1:] = map(lambda x: 9, b[i + 1:])
if sum(b) > sum(ans):
ans = b
print(int(''.join(map(str, ans))))
``` | output | 1 | 79,623 | 20 | 159,247 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the... | instruction | 0 | 79,624 | 20 | 159,248 |
Tags: *special, implementation, math
Correct Solution:
```
def sum(A):
sum = 0
for k in A:
sum += k
return sum
x = input()
numbers = []
for a in x:
numbers.append(int(a))
len = numbers.__len__()-1
max = numbers.copy()
for i in range(len):
numbers[len - i] = 9
numbers[len - i - 1] -= 1... | output | 1 | 79,624 | 20 | 159,249 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the... | instruction | 0 | 79,625 | 20 | 159,250 |
Tags: *special, implementation, math
Correct Solution:
```
a=[1, 2, 3, 4, 5, 6, 7, 8, 9, 18, 19, 28, 29, 38, 39, 48, 49, 58, 59, 68, 69, 78, 79, 88, 89, 98, 99, 189, 198, 199, 289, 298, 299, 389, 398, 399, 489, 498, 499, 589, 598, 599, 689, 698, 699, 789, 798, 799, 889, 898, 899, 989, 998, 999, 1899, 1989, 1998, 1999, ... | output | 1 | 79,625 | 20 | 159,251 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the... | instruction | 0 | 79,626 | 20 | 159,252 |
Tags: *special, implementation, math
Correct Solution:
```
def main():
x = input()
y = int(x)
s = sum(int(d) for d in x)
for i in range(len(x)):
if x[i] == '0':
continue
z = x[:i] + str(int(x[i]) - 1) + '9' * (len(x) - i - 1)
zi = int(z)
t = sum(int(d) for... | output | 1 | 79,626 | 20 | 159,253 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If there are several such integers, determine the... | instruction | 0 | 79,627 | 20 | 159,254 |
Tags: *special, implementation, math
Correct Solution:
```
t = input()
p = [t] + [int(t) - int(t[-k:]) - 1 for k in range(1, len(t))]
print(max(p, key=lambda q: sum(map(int, str(q)))))
``` | output | 1 | 79,627 | 20 | 159,255 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If... | instruction | 0 | 79,628 | 20 | 159,256 |
Yes | output | 1 | 79,628 | 20 | 159,257 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If... | instruction | 0 | 79,629 | 20 | 159,258 |
Yes | output | 1 | 79,629 | 20 | 159,259 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If... | instruction | 0 | 79,630 | 20 | 159,260 |
Yes | output | 1 | 79,630 | 20 | 159,261 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If... | instruction | 0 | 79,631 | 20 | 159,262 |
Yes | output | 1 | 79,631 | 20 | 159,263 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If... | instruction | 0 | 79,632 | 20 | 159,264 |
No | output | 1 | 79,632 | 20 | 159,265 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If... | instruction | 0 | 79,633 | 20 | 159,266 |
No | output | 1 | 79,633 | 20 | 159,267 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If... | instruction | 0 | 79,634 | 20 | 159,268 |
No | output | 1 | 79,634 | 20 | 159,269 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Anton has the integer x. He is interested what positive integer, which doesn't exceed x, has the maximum sum of digits.
Your task is to help Anton and to find the integer that interests him. If... | instruction | 0 | 79,635 | 20 | 159,270 |
No | output | 1 | 79,635 | 20 | 159,271 |
Provide a correct Python 3 solution for this coding contest problem.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.
Constraints
... | instruction | 0 | 79,765 | 20 | 159,530 |
"Correct Solution:
```
A,B=map(int,input().split())
c=0
for i in range(A,B+1):
s=str(i)
if s[0]==s[4] and s[1]==s[3]:
c+=1
print(c)
``` | output | 1 | 79,765 | 20 | 159,531 |
Provide a correct Python 3 solution for this coding contest problem.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.
Constraints
... | instruction | 0 | 79,766 | 20 | 159,532 |
"Correct Solution:
```
print(sum(s[0]==s[4]and s[1]==s[3]for s in map(str,range(*map(sum,enumerate(map(int,input().split())))))))
``` | output | 1 | 79,766 | 20 | 159,533 |
Provide a correct Python 3 solution for this coding contest problem.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.
Constraints
... | instruction | 0 | 79,767 | 20 | 159,534 |
"Correct Solution:
```
n,m=map(int,input().split())
c=0
for i in range(n,m+1):
s=str(i)
if(s==s[::-1]):
c=c+1
print(c)
``` | output | 1 | 79,767 | 20 | 159,535 |
Provide a correct Python 3 solution for this coding contest problem.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.
Constraints
... | instruction | 0 | 79,768 | 20 | 159,536 |
"Correct Solution:
```
A, B = map(int, input().split())
cnt = 0
for i in range(A, B+1):
s = str(i)
if s == s[-1::-1]: cnt += 1
print (cnt)
``` | output | 1 | 79,768 | 20 | 159,537 |
Provide a correct Python 3 solution for this coding contest problem.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.
Constraints
... | instruction | 0 | 79,769 | 20 | 159,538 |
"Correct Solution:
```
A,B = map(int,input().split())
n=0
for i in range(A,B+1):
if i == int(str(i)[::-1]):
n+=1
print(n)
``` | output | 1 | 79,769 | 20 | 159,539 |
Provide a correct Python 3 solution for this coding contest problem.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.
Constraints
... | instruction | 0 | 79,770 | 20 | 159,540 |
"Correct Solution:
```
A, B = map(int, input().split())
print([True for i in range(A, B + 1) if str(i) == str(i)[::-1]].count(True))
``` | output | 1 | 79,770 | 20 | 159,541 |
Provide a correct Python 3 solution for this coding contest problem.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.
Constraints
... | instruction | 0 | 79,771 | 20 | 159,542 |
"Correct Solution:
```
a, b = map(int, input().split())
print(sum(map(lambda x: 1 if str(x) == str(x)[::-1] else 0, range(a, b+1))))
``` | output | 1 | 79,771 | 20 | 159,543 |
Provide a correct Python 3 solution for this coding contest problem.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading zeros) reads the same forward and backward.
Constraints
... | instruction | 0 | 79,772 | 20 | 159,544 |
"Correct Solution:
```
a,b=map(int,input().split())
print(len([j for j in [str(i) for i in range(a,b+1)] if j[0]==j[4]and j[1]==j[3]]))
``` | output | 1 | 79,772 | 20 | 159,545 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading ze... | instruction | 0 | 79,776 | 20 | 159,552 |
Yes | output | 1 | 79,776 | 20 | 159,553 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading ze... | instruction | 0 | 79,777 | 20 | 159,554 |
No | output | 1 | 79,777 | 20 | 159,555 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading ze... | instruction | 0 | 79,778 | 20 | 159,556 |
No | output | 1 | 79,778 | 20 | 159,557 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Find the number of palindromic numbers among the integers between A and B (inclusive). Here, a palindromic number is a positive integer whose string representation in base 10 (without leading ze... | instruction | 0 | 79,780 | 20 | 159,560 |
No | output | 1 | 79,780 | 20 | 159,561 |
Provide tags and a correct Python 3 solution for this coding contest problem.
<image>
Input
The input contains two integers row, col (0 ≤ row, col ≤ 63), separated by a single space.
Output
Output "IN" or "OUT".
Examples
Input
0 0
Output
OUT
Input
27 0
Output
IN
Input
0 27
Output
OUT
Inpu... | instruction | 0 | 80,076 | 20 | 160,152 |
Tags: *special, dfs and similar, geometry, implementation
Correct Solution:
```
s = ["1111111111111111111111111101010000001011111111111111111111111111",
"1111111111111111111111010001010101101000001111111111111111111111",
"1111111111111111111100010111011100101111011011111111111111111111",
"111111111111111110000101010000... | output | 1 | 80,076 | 20 | 160,153 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number g... | instruction | 0 | 80,281 | 20 | 160,562 |
Tags: expression parsing, implementation
Correct Solution:
```
st=input()
i=0
ans=[]
while(i<len(st)-1):
if st[i]=='-' and st[i+1]=='.':
ans.append(1)
i+=1
elif st[i]=='.':
ans.append(0)
#print('x')
elif st[i]=='-' and st[i+1]=='-':
ans.append(2)
i+=1
i+=1
if st[len(st)-1]=='.' and st[len(st)-2]!='-':
... | output | 1 | 80,281 | 20 | 160,563 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number g... | instruction | 0 | 80,282 | 20 | 160,564 |
Tags: expression parsing, implementation
Correct Solution:
```
codigo = input()
codigo = codigo.replace('--', '2')
codigo = codigo.replace('-.', '1')
codigo = codigo.replace('.', '0')
print(codigo)
``` | output | 1 | 80,282 | 20 | 160,565 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number g... | instruction | 0 | 80,283 | 20 | 160,566 |
Tags: expression parsing, implementation
Correct Solution:
```
t = input()
t = t.replace("--","2")
t = t.replace("-.","1")
t = t.replace(".","0")
print(t)
``` | output | 1 | 80,283 | 20 | 160,567 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number g... | instruction | 0 | 80,284 | 20 | 160,568 |
Tags: expression parsing, implementation
Correct Solution:
```
code = {".": "0", "-.": "1", "--": "2"}
line = input()
answer = ""
while len(line) != 0:
if line[0] == ".":
answer = answer + code["."]
line = line[1:]
else:
answer = answer + code[line[0:2]]
line = line[2:]
print(a... | output | 1 | 80,284 | 20 | 160,569 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number g... | instruction | 0 | 80,285 | 20 | 160,570 |
Tags: expression parsing, implementation
Correct Solution:
```
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 21 19:52:42 2020
@author: Lenovo
"""
#https://codeforces.com/problemset/problem/32/B
def borze_code():
string = input()
output = ''
if len(string) == 1:
print(0)
return
... | output | 1 | 80,285 | 20 | 160,571 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number g... | instruction | 0 | 80,286 | 20 | 160,572 |
Tags: expression parsing, implementation
Correct Solution:
```
d={"-.":1,".":0,"--":2}
f=input()
b=""
w=''
n=""
for i in range(len(f)):
if (n+f[i]) in d.keys():
b=n+f[i]
w=str(w)+str((d[b]))
b=''
n=''
else:
n=f[i]
print(w)
``` | output | 1 | 80,286 | 20 | 160,573 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Borze code, i.e. to find out the ternary number g... | instruction | 0 | 80,288 | 20 | 160,576 |
Tags: expression parsing, implementation
Correct Solution:
```
n = input()
s = []
r = 20392309
for i in range(len(n)):
if i != r:
if n[i] == '.' or i == len(n)-1:
s.append(0)
elif n[i] == '-' and n[i+1] == '.':
s.append(1)
r = i+1
elif n[i] == '-' and... | output | 1 | 80,288 | 20 | 160,577 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Bo... | instruction | 0 | 80,289 | 20 | 160,578 |
Yes | output | 1 | 80,289 | 20 | 160,579 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Bo... | instruction | 0 | 80,290 | 20 | 160,580 |
Yes | output | 1 | 80,290 | 20 | 160,581 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Bo... | instruction | 0 | 80,291 | 20 | 160,582 |
Yes | output | 1 | 80,291 | 20 | 160,583 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Bo... | instruction | 0 | 80,292 | 20 | 160,584 |
Yes | output | 1 | 80,292 | 20 | 160,585 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Bo... | instruction | 0 | 80,293 | 20 | 160,586 |
No | output | 1 | 80,293 | 20 | 160,587 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Ternary numeric notation is quite popular in Berland. To telegraph the ternary number the Borze alphabet is used. Digit 0 is transmitted as «.», 1 as «-.» and 2 as «--». You are to decode the Bo... | instruction | 0 | 80,294 | 20 | 160,588 |
No | output | 1 | 80,294 | 20 | 160,589 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.