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 |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned ... | instruction | 0 | 107,103 | 20 | 214,206 |
Yes | output | 1 | 107,103 | 20 | 214,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned ... | instruction | 0 | 107,104 | 20 | 214,208 |
Yes | output | 1 | 107,104 | 20 | 214,209 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned ... | instruction | 0 | 107,105 | 20 | 214,210 |
Yes | output | 1 | 107,105 | 20 | 214,211 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned ... | instruction | 0 | 107,106 | 20 | 214,212 |
Yes | output | 1 | 107,106 | 20 | 214,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned ... | instruction | 0 | 107,107 | 20 | 214,214 |
No | output | 1 | 107,107 | 20 | 214,215 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned ... | instruction | 0 | 107,108 | 20 | 214,216 |
No | output | 1 | 107,108 | 20 | 214,217 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned ... | instruction | 0 | 107,109 | 20 | 214,218 |
No | output | 1 | 107,109 | 20 | 214,219 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a function f written in some basic language. The function accepts an integer value, which is immediately written into some variable x. x is an integer variable and can be assigned ... | instruction | 0 | 107,110 | 20 | 214,220 |
No | output | 1 | 107,110 | 20 | 214,221 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers).... | instruction | 0 | 107,111 | 20 | 214,222 |
Tags: math
Correct Solution:
```
a=int(input())
for number in range(0,a):
n,x= map(int,input().split())
print(x*2)
``` | output | 1 | 107,111 | 20 | 214,223 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers).... | instruction | 0 | 107,112 | 20 | 214,224 |
Tags: math
Correct Solution:
```
q=int(input())
for i in range(q):
w,e=map(int,input().split())
print(e*2)
``` | output | 1 | 107,112 | 20 | 214,225 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers).... | instruction | 0 | 107,113 | 20 | 214,226 |
Tags: math
Correct Solution:
```
for i in range(int(input())):
x = list(map(int, input().split(" ")))
print(x[1]*2)
#Ψ§Ϊ©Ψ³ΩΎΨͺ Ψ΄Ω
#Ψ¨Ω ΩΩΩ /Ω
/Ψ§ΫΩ Ω
Ψ§Ϋ Ψ³ΩΫΫΨͺ ΩΩΩ
``` | output | 1 | 107,113 | 20 | 214,227 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers).... | instruction | 0 | 107,114 | 20 | 214,228 |
Tags: math
Correct Solution:
```
"""609C"""
# import math
# import sys
def main():
n, d = map(int, input().split())
print(2*d)
return
# main()
def test():
t= int(input())
while t:
main()
t-=1
test()
``` | output | 1 | 107,114 | 20 | 214,229 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers).... | instruction | 0 | 107,115 | 20 | 214,230 |
Tags: math
Correct Solution:
```
n = int(input())
for i in range(0, n):
n , x = map(int,input().split())
if x * 2 < n:
print(x*2)
else:
print(n)
``` | output | 1 | 107,115 | 20 | 214,231 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers).... | instruction | 0 | 107,116 | 20 | 214,232 |
Tags: math
Correct Solution:
```
tc = int(input())
while (tc > 0):
tc -= 1
a, b = [int(x) for x in input().split()]
print(b * 2)
``` | output | 1 | 107,116 | 20 | 214,233 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers).... | instruction | 0 | 107,117 | 20 | 214,234 |
Tags: math
Correct Solution:
```
#!/usr/bin/env python
# coding: utf-8
# In[9]:
req_num = input()
req_list = []
for i in range(int(req_num)):
req_list.append([int(j) for j in input().split()])
# In[12]:
for i in req_list:
print(i[1]*2)
``` | output | 1 | 107,117 | 20 | 214,235 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers).... | instruction | 0 | 107,118 | 20 | 214,236 |
Tags: math
Correct Solution:
```
TestCase = int(input())
while( TestCase > 0 ):
[n,x] = list( map( int,input().split() ) )
print(2*x)
TestCase -= 1
``` | output | 1 | 107,118 | 20 | 214,237 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You know that the Martians use a number system with base k. Digit b (0 β€ b < k) is considered lucky, as the first contact between the Martians and the Earthlings occurred in year b (by Martian chronology).
A digital root d(x) of number x is... | instruction | 0 | 107,269 | 20 | 214,538 |
Tags: math, number theory
Correct Solution:
```
Line1 = list(map(int,input().split()))
List = list(map(int,input().split()))
def MartianLuck(k,b,n,digit_list):
if b == 0:
return Zero(n,digit_list)
Subarray = dict()
Subarray[0]=1
LuckyNumbersCounter = 0
ActualNumber = 0
for Digit i... | output | 1 | 107,269 | 20 | 214,539 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You know that the Martians use a number system with base k. Digit b (0 β€ b < k) is considered lucky, as the first contact between the Martians and the Earthlings occurred in year b (by Martian chronology).
A digital root d(x) of number x is... | instruction | 0 | 107,270 | 20 | 214,540 |
Tags: math, number theory
Correct Solution:
```
k, b, n = map(int, input().split())
digits = list(map(int, input().split()))
def ans0():
j = -1
answer = 0
for i in range(n):
if digits[i] != 0 or i < j:
continue
j = i
while j < n and digits[j] == 0:
j += 1
... | output | 1 | 107,270 | 20 | 214,541 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You know that the Martians use a number system with base k. Digit b (0 β€ b < k) is considered lucky, as the first contact between the Martians and the Earthlings occurred in year b (by Martian c... | instruction | 0 | 107,271 | 20 | 214,542 |
No | output | 1 | 107,271 | 20 | 214,543 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You know that the Martians use a number system with base k. Digit b (0 β€ b < k) is considered lucky, as the first contact between the Martians and the Earthlings occurred in year b (by Martian c... | instruction | 0 | 107,272 | 20 | 214,544 |
No | output | 1 | 107,272 | 20 | 214,545 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You know that the Martians use a number system with base k. Digit b (0 β€ b < k) is considered lucky, as the first contact between the Martians and the Earthlings occurred in year b (by Martian c... | instruction | 0 | 107,273 | 20 | 214,546 |
No | output | 1 | 107,273 | 20 | 214,547 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You know that the Martians use a number system with base k. Digit b (0 β€ b < k) is considered lucky, as the first contact between the Martians and the Earthlings occurred in year b (by Martian c... | instruction | 0 | 107,274 | 20 | 214,548 |
No | output | 1 | 107,274 | 20 | 214,549 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number... | instruction | 0 | 107,423 | 20 | 214,846 |
Tags: brute force, implementation
Correct Solution:
```
import sys
def solve():
n, = rv()
works = 0
lastworks = -1
guesses = list()
for i in range(n):
a, b, c, = rv()
acopy = a
charcount = [0] * 10
for x in range(4):
charcount[acopy % 10] += 1
... | output | 1 | 107,423 | 20 | 214,847 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number... | instruction | 0 | 107,424 | 20 | 214,848 |
Tags: brute force, implementation
Correct Solution:
```
#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import*
from io import BytesIO, IOBase
def vsInput():
sys.stdin = open('input... | output | 1 | 107,424 | 20 | 214,849 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number... | instruction | 0 | 107,425 | 20 | 214,850 |
Tags: brute force, implementation
Correct Solution:
```
import sys
def tolist(i):
listx = list()
while i > 0:
listx.append(i % 10)
i //= 10
while len(listx) < 4: listx.append(0)
return listx[::-1]
def diff(i):
count = [0] * 10
for x in range(4):
count[i % 10] += 1
... | output | 1 | 107,425 | 20 | 214,851 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number... | instruction | 0 | 107,426 | 20 | 214,852 |
Tags: brute force, implementation
Correct Solution:
```
import sys
def solve():
n, = rv()
works = 0
lastworks = -1
guesses = list()
for i in range(n):
a, b, c, = rv()
acopy = a
charcount = [0] * 10
for x in range(4):
charcount[acopy % 10] += 1
... | output | 1 | 107,426 | 20 | 214,853 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number... | instruction | 0 | 107,427 | 20 | 214,854 |
Tags: brute force, implementation
Correct Solution:
```
# cook your dish here
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutati... | output | 1 | 107,427 | 20 | 214,855 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number... | instruction | 0 | 107,428 | 20 | 214,856 |
Tags: brute force, implementation
Correct Solution:
```
import sys
lines = sys.stdin.readlines()
n = int(lines[0].strip())
query = []
for i in range(1, n+1):
(a, b, c) = lines[i].strip().split(" ")
query.append((a, int(b), int(c)))
def compare(i):
digits = str(i)
digits = "0" *(4-len(digits)) + digits
... | output | 1 | 107,428 | 20 | 214,857 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number... | instruction | 0 | 107,429 | 20 | 214,858 |
Tags: brute force, implementation
Correct Solution:
```
def filter(candidates, num, rp, wp):
ans = []
for cand in candidates:
crp = cwp = 0
for a, b in zip(cand, num):
if a == b:
crp += 1
elif a in num:
cwp += 1
if crp == rp and cw... | output | 1 | 107,429 | 20 | 214,859 |
Provide tags and a correct Python 3 solution for this coding contest problem.
The "Bulls and Cows" game needs two people to play. The thinker thinks of a number and the guesser tries to guess it.
The thinker thinks of a four-digit number in the decimal system. All the digits in the number are different and the number... | instruction | 0 | 107,430 | 20 | 214,860 |
Tags: brute force, implementation
Correct Solution:
```
n=int(input())
array=[str(t).zfill(4) for t in range(10000) if len(set(str(t).zfill(4)))==4]
# print (array)
for _ in range(n):
a,b,c=input().split()
b=int(b)
c=int(c)
# for u in array:
# print (u, set(u).intersection(set(a)))
array=[u ... | output | 1 | 107,430 | 20 | 214,861 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:
1. + ai β add non-negative integer ... | instruction | 0 | 107,471 | 20 | 214,942 |
Tags: data structures, implementation
Correct Solution:
```
#!/usr/local/env python3
# -*- encoding: utf-8 -*-
import sys
import re
def mask2(s):
m = int("0", 2)
while len(s) > 0:
m *= 2
m += int(s[0]) % 2
s = s[1:]
return m
def mask(s):
return int(re.sub("[02468]", "0", re.... | output | 1 | 107,471 | 20 | 214,943 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:
1. + ai β add non-negative integer ... | instruction | 0 | 107,472 | 20 | 214,944 |
Tags: data structures, implementation
Correct Solution:
```
from sys import stdin, stdout
quests = int(stdin.readline().rstrip())
multi_set = {}
p = str.maketrans('0123456789', '0101010101')
for i in range(quests):
quest, core = stdin.readline().rstrip().split()
pattern = int(core.translate(p))
if quest == ... | output | 1 | 107,472 | 20 | 214,945 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:
1. + ai β add non-negative integer ... | instruction | 0 | 107,473 | 20 | 214,946 |
Tags: data structures, implementation
Correct Solution:
```
t = int(input())
trantab = str.maketrans('0123456789', '0101010101')
a = {}
for i in range(t):
string = input()
oper, number = string.split()
pattern = int(number.translate(trantab))
if oper == '+':
a[pattern] = a.get(pattern, 0) + 1
... | output | 1 | 107,473 | 20 | 214,947 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:
1. + ai β add non-negative integer ... | instruction | 0 | 107,474 | 20 | 214,948 |
Tags: data structures, implementation
Correct Solution:
```
# Description of the problem can be found at http://codeforces.com/problemset/problem/713/A
from collections import defaultdict
from sys import stdin
from sys import stdout
n = int(stdin.readline())
d = defaultdict(int)
for _ in range(n):
s, x =... | output | 1 | 107,474 | 20 | 214,949 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:
1. + ai β add non-negative integer ... | instruction | 0 | 107,475 | 20 | 214,950 |
Tags: data structures, implementation
Correct Solution:
```
num = int(input())
multiset = [0] * 2 ** 18
t = str.maketrans('0123456789', '0101010101')
while num:
opr = input().split()
if opr[0] == '+':
multiset[int(opr[1].translate(t), 2)] += 1
elif opr[0] == '-':
multiset[int(opr[1].transla... | output | 1 | 107,475 | 20 | 214,951 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:
1. + ai β add non-negative integer ... | instruction | 0 | 107,476 | 20 | 214,952 |
Tags: data structures, implementation
Correct Solution:
```
n = int(input())
ans = [0] * 2 ** 18
trantab = str.maketrans('0123456789', '0101010101')
for i in range(n):
ch, s = map(str, input().split())
if ch == '+':
ans[int(s.translate(trantab), 2)] += 1
elif ch == '-':
ans[int(s.translate(... | output | 1 | 107,476 | 20 | 214,953 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:
1. + ai β add non-negative integer ... | instruction | 0 | 107,477 | 20 | 214,954 |
Tags: data structures, implementation
Correct Solution:
```
# Problem : C. Sonya and Queries
# Contest : Codeforces Round #371 (Div. 2)
# URL : https://codeforces.com/contest/714/problem/C
# Memory Limit : 256 MB
# Time Limit : 1000 ms
# Powered by CP Editor (https://github.com/cpeditor/cpeditor)
"""
// Author : snap... | output | 1 | 107,477 | 20 | 214,955 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the following type:
1. + ai β add non-negative integer ... | instruction | 0 | 107,478 | 20 | 214,956 |
Tags: data structures, implementation
Correct Solution:
```
import sys
import math
import collections
import heapq
input=sys.stdin.readline
d={}
t=int(input())
for w in range(t):
x,y=(i for i in input().split())
y=list(y)
k=len(y)
for i in range(k):
if(int(y[i])%2==0):
y[i]='0'
... | output | 1 | 107,478 | 20 | 214,957 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the followin... | instruction | 0 | 107,479 | 20 | 214,958 |
Yes | output | 1 | 107,479 | 20 | 214,959 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the followin... | instruction | 0 | 107,480 | 20 | 214,960 |
Yes | output | 1 | 107,480 | 20 | 214,961 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the followin... | instruction | 0 | 107,481 | 20 | 214,962 |
Yes | output | 1 | 107,481 | 20 | 214,963 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the followin... | instruction | 0 | 107,482 | 20 | 214,964 |
Yes | output | 1 | 107,482 | 20 | 214,965 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the followin... | instruction | 0 | 107,483 | 20 | 214,966 |
No | output | 1 | 107,483 | 20 | 214,967 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the followin... | instruction | 0 | 107,484 | 20 | 214,968 |
No | output | 1 | 107,484 | 20 | 214,969 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the followin... | instruction | 0 | 107,485 | 20 | 214,970 |
No | output | 1 | 107,485 | 20 | 214,971 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Today Sonya learned about long integers and invited all her friends to share the fun. Sonya has an initially empty multiset with integers. Friends give her t queries, each of one of the followin... | instruction | 0 | 107,486 | 20 | 214,972 |
No | output | 1 | 107,486 | 20 | 214,973 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Apart from having lots of holidays throughout the year, residents of Berland also have whole lucky years. Year is considered lucky if it has no more than 1 non-zero digit in its number. So years 100, 40000, 5 are lucky and 12, 3001 and 12345... | instruction | 0 | 108,319 | 20 | 216,638 |
Tags: implementation
Correct Solution:
```
from math import *
a=input()
if len(a)==1:
print("1")
exit(0)
elif len(a)-a.count("0")==1:
print(10**a.count("0"))
exit(0)
else:
b=len(a)-1
a=int(a)
c=a/(10**b)
c=ceil(c)
c*=(10**b)
print(c-a)
``` | output | 1 | 108,319 | 20 | 216,639 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.