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.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya has two strin... | instruction | 0 | 13,520 | 20 | 27,040 |
Tags: greedy, implementation
Correct Solution:
```
a = input()
b = input()
n = len(a)
x = 0
y = 0
for i in range(n):
if a[i] == '4' and b[i] == '7':
x += 1
if a[i] == '7' and b[i] == '4':
y += 1
print(max(x, y))
``` | output | 1 | 13,520 | 20 | 27,041 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya has two strin... | instruction | 0 | 13,521 | 20 | 27,042 |
Tags: greedy, implementation
Correct Solution:
```
c47,c74=0,0
a,b=input(),input()
for i in range(len(a)):
if a[i]==b[i]:continue
if a[i]=='4':
c47+=1
else:
c74+=1
print(max(c47,c74))
``` | output | 1 | 13,521 | 20 | 27,043 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya has two strin... | instruction | 0 | 13,522 | 20 | 27,044 |
Tags: greedy, implementation
Correct Solution:
```
a=input()
b=input()
k1=0
k2=0
for i in range (len(a)):
if a[i]!=b[i]:
if a[i]=='4':
k1+=1
else:
k2+=1
d=max(k1,k2)
print (d)
``` | output | 1 | 13,522 | 20 | 27,045 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya has two strin... | instruction | 0 | 13,523 | 20 | 27,046 |
Tags: greedy, implementation
Correct Solution:
```
import sys
read=sys.stdin.buffer.readline
mi=lambda:map(int,read().split())
li=lambda:list(mi())
cin=lambda:int(read())
a=input()
b=input()
d={'4':0,'7':0}
for i in range(len(a)):
if a[i]!=b[i]:
d[b[i]]+=1
print(max(d['4'],d['7']))
``` | output | 1 | 13,523 | 20 | 27,047 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc... | instruction | 0 | 13,524 | 20 | 27,048 |
Yes | output | 1 | 13,524 | 20 | 27,049 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc... | instruction | 0 | 13,525 | 20 | 27,050 |
Yes | output | 1 | 13,525 | 20 | 27,051 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc... | instruction | 0 | 13,526 | 20 | 27,052 |
Yes | output | 1 | 13,526 | 20 | 27,053 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc... | instruction | 0 | 13,527 | 20 | 27,054 |
Yes | output | 1 | 13,527 | 20 | 27,055 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc... | instruction | 0 | 13,528 | 20 | 27,056 |
No | output | 1 | 13,528 | 20 | 27,057 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc... | instruction | 0 | 13,529 | 20 | 27,058 |
No | output | 1 | 13,529 | 20 | 27,059 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc... | instruction | 0 | 13,530 | 20 | 27,060 |
No | output | 1 | 13,530 | 20 | 27,061 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are luc... | instruction | 0 | 13,531 | 20 | 27,062 |
No | output | 1 | 13,531 | 20 | 27,063 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary r... | instruction | 0 | 13,641 | 20 | 27,282 |
Tags: binary search, bitmasks, combinatorics, dp, math
Correct Solution:
```
import sys
def b(n):
c = 0
while n:
if n & 1:
c += 1
n //= 2
return c
c = {}
def f(n, k):
if (n, k) in c.keys():
return c[(n, k)]
if n == 1:
return 1 if k == 1 else 0
c[(n,... | output | 1 | 13,641 | 20 | 27,283 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary r... | instruction | 0 | 13,642 | 20 | 27,284 |
Tags: binary search, bitmasks, combinatorics, dp, math
Correct Solution:
```
MX_BIT = 64
C = [[int(0) for i in range(MX_BIT)] for j in range(MX_BIT)]
def ck(x, i):
return (x>>i) & 1
def tot_bits(x):
x = bin(x)[2:]
return len(x)
def mkt():
C[0][0] = 1
for i in range (1, MX_BIT):
for j in range (i+1):
C[i][j] ... | output | 1 | 13,642 | 20 | 27,285 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary r... | instruction | 0 | 13,643 | 20 | 27,286 |
Tags: binary search, bitmasks, combinatorics, dp, math
Correct Solution:
```
def dfs(n, k, cache = {}):
# if number of bits is bigger than the number's bits of the number's bits is less than 0
if k > n or k < 0: return 0
# if num bits is 0 or num bits is equivalent to the number's bits
if k == 0 or k ==... | output | 1 | 13,643 | 20 | 27,287 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary r... | instruction | 0 | 13,644 | 20 | 27,288 |
Tags: binary search, bitmasks, combinatorics, dp, math
Correct Solution:
```
N = 70
C = [[0 for _ in range(N)] for _ in range(N)]
for i in range(N):
C[i][0] = C[i][i] = 1
for j in range(1, i):
C[i][j] = C[i - 1][j - 1] + C[i - 1][j]
l, r = 1, int(1e19)
m, k = [int(x) for x in input().split(' ')]
k -= 1... | output | 1 | 13,644 | 20 | 27,289 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary r... | instruction | 0 | 13,645 | 20 | 27,290 |
Tags: binary search, bitmasks, combinatorics, dp, math
Correct Solution:
```
comb = [[0 for i in range(67)] for j in range(67)]
for i in range(67):
comb[i][0], comb[i][i] = 1, 1
for j in range(1, i):
comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j]
def calc(x):
cnt = 0
digit = []
while (... | output | 1 | 13,645 | 20 | 27,291 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary r... | instruction | 0 | 13,646 | 20 | 27,292 |
Tags: binary search, bitmasks, combinatorics, dp, math
Correct Solution:
```
def dfs(n, k, cache = {}):
# if number of bits is bigger than the number's bits of the number's bits is less than 0
if k > n or k < 0: return 0
# if num bits is 0 or num bits is equivalent to the number's bits
if k == 0 or k ==... | output | 1 | 13,646 | 20 | 27,293 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary r... | instruction | 0 | 13,647 | 20 | 27,294 |
Tags: binary search, bitmasks, combinatorics, dp, math
Correct Solution:
```
def dfs(n, k, cache = {}):
# if number of bits is bigger than the number's bits of the number's bits is less than 0
if k > n or k < 0: return 0
# if num bits is 0 or num bits is equivalent to the number's bits
if k == 0 or k ==... | output | 1 | 13,647 | 20 | 27,295 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ..., 2·n there are exactly m numbers which binary r... | instruction | 0 | 13,648 | 20 | 27,296 |
Tags: binary search, bitmasks, combinatorics, dp, math
Correct Solution:
```
def nck(n, k, cache = {}):
if k > n or k < 0: return 0
if k == 0 or k == n: return 1
if k*2 > n: k = n-k
if (n, k) in cache: return cache[(n, k)]
z = cache[(n, k)] = nck(n-1, k-1) + nck(n-1, k)
return z
def bits(n):
... | output | 1 | 13,648 | 20 | 27,297 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ...,... | instruction | 0 | 13,649 | 20 | 27,298 |
Yes | output | 1 | 13,649 | 20 | 27,299 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ...,... | instruction | 0 | 13,650 | 20 | 27,300 |
Yes | output | 1 | 13,650 | 20 | 27,301 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ...,... | instruction | 0 | 13,651 | 20 | 27,302 |
No | output | 1 | 13,651 | 20 | 27,303 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ...,... | instruction | 0 | 13,652 | 20 | 27,304 |
No | output | 1 | 13,652 | 20 | 27,305 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ...,... | instruction | 0 | 13,653 | 20 | 27,306 |
No | output | 1 | 13,653 | 20 | 27,307 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One day, after a difficult lecture a diligent student Sasha saw a graffitied desk in the classroom. She came closer and read: "Find such positive integer n, that among numbers n + 1, n + 2, ...,... | instruction | 0 | 13,654 | 20 | 27,308 |
No | output | 1 | 13,654 | 20 | 27,309 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Problem statement
Cards with ranks of $ 2 $ and $ 8 $ are powerful in card game millionaires. Therefore, we call an integer consisting of only the numbers $ 2 $ and $ 8 $ in $ 10 $ decimal nota... | instruction | 0 | 14,107 | 20 | 28,214 |
No | output | 1 | 14,107 | 20 | 28,215 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya and his friend ... | instruction | 0 | 14,186 | 20 | 28,372 |
Tags: brute force, probabilities
Correct Solution:
```
s = list()
def rec(x):
if x > 100000000000:
return
s.append(x)
rec(x * 10 + 4)
rec(x * 10 + 7)
def f(l1, r1, l2, r2):
l1 = max(l1, l2)
r1 = min(r1, r2)
return max(r1 - l1 + 1, 0)
def main():
rec(0)
s.sort()
args =... | output | 1 | 14,186 | 20 | 28,373 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya and his friend ... | instruction | 0 | 14,187 | 20 | 28,374 |
Tags: brute force, probabilities
Correct Solution:
```
def gen(n, cur):
if n == 0:
global arr
arr.append(cur)
else:
gen(n - 1, cur + '4')
gen(n - 1, cur + '7')
def lseg(x1, x2):
if x2 < x1:
return 0
return x2 - x1 + 1
def inter2(x1, x2, a, b):
left = max(x1,... | output | 1 | 14,187 | 20 | 28,375 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya and his friend ... | instruction | 0 | 14,188 | 20 | 28,376 |
Tags: brute force, probabilities
Correct Solution:
```
import itertools as it
all_lucky = []
for length in range(1, 10):
for comb in it.product(['7', '4'], repeat=length):
all_lucky += [int(''.join(comb))]
all_lucky.sort()
# print(len(all_lucky))
pl, pr, vl, vr, k = map(int, input().split())
result ... | output | 1 | 14,188 | 20 | 28,377 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya and his friend ... | instruction | 0 | 14,189 | 20 | 28,378 |
Tags: brute force, probabilities
Correct Solution:
```
def gen_len(l):
gen = []
for i in range(2 ** l):
k = int(bin(i)[2:].rjust(l, '0').replace('0', '4').replace('1', '7'))
if k <= 10 ** 9:
gen.append(k)
return gen
def pairs_with_k_len(a, k):
l = 0
r = k - 1
while ... | output | 1 | 14,189 | 20 | 28,379 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya and his friend ... | instruction | 0 | 14,190 | 20 | 28,380 |
Tags: brute force, probabilities
Correct Solution:
```
import itertools
def generate_happy():
happy_digits = '47'
happies = []
for num_len in range(1, 10):
happies.extend(itertools.product(happy_digits, repeat=num_len))
return [int(''.join(num)) for num in happies]
def clamp_segment(start, ... | output | 1 | 14,190 | 20 | 28,381 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya and his friend ... | instruction | 0 | 14,191 | 20 | 28,382 |
Tags: brute force, probabilities
Correct Solution:
```
import itertools as it
all_lucky = []
for length in range(1, 10):
for comb in it.product(['7', '4'], repeat=length):
all_lucky += [int(''.join(comb))]
all_lucky.sort()
# print(len(all_lucky))
pl, pr, vl, vr, k = map(int, input().split())
result ... | output | 1 | 14,191 | 20 | 28,383 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya and his friend ... | instruction | 0 | 14,192 | 20 | 28,384 |
Tags: brute force, probabilities
Correct Solution:
```
#!/usr/bin/env python3
import itertools
pl,pr,vl,vr,k = map(int, input().split())
l = min(pl, vl)
r = max(pr, vr)
# Generate all lucky numbers with the appropriate number of digits
# O(3**max_nr_digits) = O(3**9) < 20000
max_nr_digits = len(str(r))
lucky_numbers... | output | 1 | 14,192 | 20 | 28,385 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.
Petya and his friend ... | instruction | 0 | 14,193 | 20 | 28,386 |
Tags: brute force, probabilities
Correct Solution:
```
#!/usr/bin/env python3
vl, vr, pl, pr, k = map(int, input().split())
lucky = [4, 7]
sz = 0
for i in range(1, 9):
base = 10 ** i
psz, sz = sz, len(lucky)
for j in [4 * base, 7 * base]:
for pos in range(psz, sz):
lucky.append(j + luck... | output | 1 | 14,193 | 20 | 28,387 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky... | instruction | 0 | 14,194 | 20 | 28,388 |
No | output | 1 | 14,194 | 20 | 28,389 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky... | instruction | 0 | 14,195 | 20 | 28,390 |
No | output | 1 | 14,195 | 20 | 28,391 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky... | instruction | 0 | 14,196 | 20 | 28,392 |
No | output | 1 | 14,196 | 20 | 28,393 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky... | instruction | 0 | 14,197 | 20 | 28,394 |
No | output | 1 | 14,197 | 20 | 28,395 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.
Let's remember how Fibonacci num... | instruction | 0 | 14,433 | 20 | 28,866 |
Tags: brute force, constructive algorithms, implementation, number theory
Correct Solution:
```
def hexa(n):
l=[]
l.append(0)
l.append(1)
i=2
while n not in l:
l.append(l[i-1]+l[i-2])
i=i+1
m=l.index(n)
if n==1:
return("1 0 0")
elif n==2:
ret... | output | 1 | 14,433 | 20 | 28,867 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.
Let's remember how Fibonacci num... | instruction | 0 | 14,434 | 20 | 28,868 |
Tags: brute force, constructive algorithms, implementation, number theory
Correct Solution:
```
n=int(input())
if n==0:
print(0,0,0)
elif n==1:
print(0,0,1)
elif n==2:
print(0,1,1)
else:
old = 0
i = 1
old = 1
vold= 1
while i<n:
vold = old
old = i
... | output | 1 | 14,434 | 20 | 28,869 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.
Let's remember how Fibonacci num... | instruction | 0 | 14,435 | 20 | 28,870 |
Tags: brute force, constructive algorithms, implementation, number theory
Correct Solution:
```
def f(num):
global fib
for i in fib:
for j in fib:
for k in fib:
if i + j + k == num:
print(i, j, k)
return
print("I'm too stupid to sol... | output | 1 | 14,435 | 20 | 28,871 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.
Let's remember how Fibonacci num... | instruction | 0 | 14,436 | 20 | 28,872 |
Tags: brute force, constructive algorithms, implementation, number theory
Correct Solution:
```
n=int(input())
fibo=[0,1]
for i in range(50):
fibo.append(fibo[i+1]+fibo[i])
i=fibo.index(n)
if i>2:
print(fibo[i-2],fibo[i-2],fibo[i-3])
elif n==1:
print('0 0 1')
elif n==0:
print("0 0 0")
``` | output | 1 | 14,436 | 20 | 28,873 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.
Let's remember how Fibonacci num... | instruction | 0 | 14,437 | 20 | 28,874 |
Tags: brute force, constructive algorithms, implementation, number theory
Correct Solution:
```
def binarysearch(L,left,right,k):
mid=(left+right)//2
if(L[left]==k):
return left
elif(L[right]==k):
return right
elif(L[mid]==k):
return mid
elif(L[right]<k) or (L[left]>k):
return -1
elif(L[mid]<k):
return ... | output | 1 | 14,437 | 20 | 28,875 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.
Let's remember how Fibonacci num... | instruction | 0 | 14,438 | 20 | 28,876 |
Tags: brute force, constructive algorithms, implementation, number theory
Correct Solution:
```
# Name : Jugal Kishore Chanda
# East West University
# Dept of Cse
n = int(input())
print("0 0 {}".format(n))
``` | output | 1 | 14,438 | 20 | 28,877 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.
Let's remember how Fibonacci num... | instruction | 0 | 14,439 | 20 | 28,878 |
Tags: brute force, constructive algorithms, implementation, number theory
Correct Solution:
```
n = int(input())
re_list = [0]
a, b = 0, 1
while b < n:
re_list.append(b)
a, b = b, a+b
if n == 0:
print("0 0 0")
elif n == 1:
print("0 0 1")
else:
print(0, re_list[-2], re_list[-1])
... | output | 1 | 14,439 | 20 | 28,879 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibonacci numbers.
Let's remember how Fibonacci num... | instruction | 0 | 14,440 | 20 | 28,880 |
Tags: brute force, constructive algorithms, implementation, number theory
Correct Solution:
```
def calc(foo):
if foo == 2:
print("0 1 1")
return
if foo == 3:
print("1 1 1")
return
if foo == 0:
print("0 0 0")
return
if foo == 1:
pri... | output | 1 | 14,440 | 20 | 28,881 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibon... | instruction | 0 | 14,441 | 20 | 28,882 |
Yes | output | 1 | 14,441 | 20 | 28,883 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibon... | instruction | 0 | 14,442 | 20 | 28,884 |
Yes | output | 1 | 14,442 | 20 | 28,885 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Recently, a chaotic virus Hexadecimal advanced a new theorem which will shake the Universe. She thinks that each Fibonacci number can be represented as sum of three not necessary different Fibon... | instruction | 0 | 14,443 | 20 | 28,886 |
Yes | output | 1 | 14,443 | 20 | 28,887 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.