message stringlengths 2 67k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 463 109k | cluster float64 19 19 | __index_level_0__ int64 926 217k |
|---|---|---|---|---|---|
Provide tags and a correct Python 3 solution for this coding contest problem.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says... | instruction | 0 | 7,210 | 19 | 14,420 |
Tags: math, number theory
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
# ----------------------... | output | 1 | 7,210 | 19 | 14,421 |
Provide tags and a correct Python 3 solution for this coding contest problem.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says... | instruction | 0 | 7,211 | 19 | 14,422 |
Tags: math, number theory
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
# region fastio
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not ... | output | 1 | 7,211 | 19 | 14,423 |
Provide tags and a correct Python 3 solution for this coding contest problem.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says... | instruction | 0 | 7,212 | 19 | 14,424 |
Tags: math, number theory
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
mod = 10 ** 9 + 7
mod1 = 998244353
# ----------------------... | output | 1 | 7,212 | 19 | 14,425 |
Provide tags and a correct Python 3 solution for this coding contest problem.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says... | instruction | 0 | 7,213 | 19 | 14,426 |
Tags: math, number theory
Correct Solution:
```
import os, sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
... | output | 1 | 7,213 | 19 | 14,427 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a nat... | instruction | 0 | 7,214 | 19 | 14,428 |
Yes | output | 1 | 7,214 | 19 | 14,429 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a nat... | instruction | 0 | 7,215 | 19 | 14,430 |
Yes | output | 1 | 7,215 | 19 | 14,431 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a nat... | instruction | 0 | 7,216 | 19 | 14,432 |
No | output | 1 | 7,216 | 19 | 14,433 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a nat... | instruction | 0 | 7,217 | 19 | 14,434 |
No | output | 1 | 7,217 | 19 | 14,435 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a nat... | instruction | 0 | 7,218 | 19 | 14,436 |
No | output | 1 | 7,218 | 19 | 14,437 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
<image>
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.
The game consists of multiple rounds. Its rules are very simple: in each round, a nat... | instruction | 0 | 7,219 | 19 | 14,438 |
No | output | 1 | 7,219 | 19 | 14,439 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single integer: the i-th card contains number c_i. Als... | instruction | 0 | 7,266 | 19 | 14,532 |
Tags: dp
Correct Solution:
```
from __future__ import print_function
from queue import Queue
import sys
import math
import os.path
# CONFIG
sys.setrecursionlimit(10**9)
# LOG
def log(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
# INPUT
def ni():
return map(int, input().split())
def nio(offset... | output | 1 | 7,266 | 19 | 14,533 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single integer: the i-th card contains number c_i. Als... | instruction | 0 | 7,267 | 19 | 14,534 |
Tags: dp
Correct Solution:
```
def solve():
n, k = map(int, input().split())
c = list(map(int, input().split()))
f = list(map(int, input().split()))
h = list(map(int, input().split()))
cnt = {}
for i in c:
cnt[i] = cnt.get(i, 0) + 1
likecolor = {}
for i in range(n):
likec... | output | 1 | 7,267 | 19 | 14,535 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single integer: the i-th card contains number c_i. Als... | instruction | 0 | 7,268 | 19 | 14,536 |
Tags: dp
Correct Solution:
```
from __future__ import print_function
from queue import Queue
import sys
import math
import os.path
sys.setrecursionlimit(10**9)
def log(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def ni():
return map(int, input().split())
def nio(offset):
return map(lambd... | output | 1 | 7,268 | 19 | 14,537 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single integer: the i-th card contains number c_i. Als... | instruction | 0 | 7,269 | 19 | 14,538 |
Tags: dp
Correct Solution:
```
n,k= map(int,input().split(' '))
l= list(map(int,input().split(' ')))
f =list(map(int,input().split(' ')))
h=list(map(int,input().split(' ')))
d1=dict({(a,0) for a in f})
d2=dict({(a,0) for a in f})
for a in l:
if(a in d1):d1[a]+=1
for a in f:
d2[a]+=1
#print(d1,d2)
dp = [[0 for i in ra... | output | 1 | 7,269 | 19 | 14,539 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single integer: the i-th card contains number c_i. Als... | instruction | 0 | 7,270 | 19 | 14,540 |
Tags: dp
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
# region fastio
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
... | output | 1 | 7,270 | 19 | 14,541 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single integer: the i-th card contains number c_i. Als... | instruction | 0 | 7,271 | 19 | 14,542 |
Tags: dp
Correct Solution:
```
# by the authority of GOD author: manhar singh sachdev #
import os,sys
from io import BytesIO,IOBase
def main():
n,k = map(int,input().split())
card = list(map(int,input().split()))
fav = list(map(int,input().split()))
joy = [0]+list(map(int,input().split()))
dp ... | output | 1 | 7,271 | 19 | 14,543 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single integer: the i-th card contains number c_i. Als... | instruction | 0 | 7,272 | 19 | 14,544 |
Tags: dp
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
# region fastio
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r" not in file.mode
... | output | 1 | 7,272 | 19 | 14,545 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single integer: the i-th card contains number c_i. Als... | instruction | 0 | 7,273 | 19 | 14,546 |
Tags: dp
Correct Solution:
```
from __future__ import print_function
from queue import Queue
import sys
import math
import os.path
# CONFIG
sys.setrecursionlimit(10**9)
# LOG
def log(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
# INPUT
def ni():
return map(int, input().split())
def nio(offset... | output | 1 | 7,273 | 19 | 14,547 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single ... | instruction | 0 | 7,274 | 19 | 14,548 |
Yes | output | 1 | 7,274 | 19 | 14,549 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single ... | instruction | 0 | 7,275 | 19 | 14,550 |
Yes | output | 1 | 7,275 | 19 | 14,551 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single ... | instruction | 0 | 7,276 | 19 | 14,552 |
Yes | output | 1 | 7,276 | 19 | 14,553 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single ... | instruction | 0 | 7,277 | 19 | 14,554 |
Yes | output | 1 | 7,277 | 19 | 14,555 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single ... | instruction | 0 | 7,278 | 19 | 14,556 |
No | output | 1 | 7,278 | 19 | 14,557 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single ... | instruction | 0 | 7,279 | 19 | 14,558 |
No | output | 1 | 7,279 | 19 | 14,559 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single ... | instruction | 0 | 7,280 | 19 | 14,560 |
No | output | 1 | 7,280 | 19 | 14,561 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are n players sitting at the card table. Each player has a favorite number. The favorite number of the j-th player is f_j.
There are k ⋅ n cards on the table. Each card contains a single ... | instruction | 0 | 7,281 | 19 | 14,562 |
No | output | 1 | 7,281 | 19 | 14,563 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice, Bob and Charlie are playing Card Game for Three, as below:
* At first, each of the three players has a deck consisting of some number of cards. Alice's deck has N cards, Bob's deck has M... | instruction | 0 | 7,418 | 19 | 14,836 |
No | output | 1 | 7,418 | 19 | 14,837 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice, Bob and Charlie are playing Card Game for Three, as below:
* At first, each of the three players has a deck consisting of some number of cards. Alice's deck has N cards, Bob's deck has M... | instruction | 0 | 7,419 | 19 | 14,838 |
No | output | 1 | 7,419 | 19 | 14,839 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice, Bob and Charlie are playing Card Game for Three, as below:
* At first, each of the three players has a deck consisting of some number of cards. Alice's deck has N cards, Bob's deck has M... | instruction | 0 | 7,420 | 19 | 14,840 |
No | output | 1 | 7,420 | 19 | 14,841 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, wi... | instruction | 0 | 7,565 | 19 | 15,130 |
Tags: implementation
Correct Solution:
```
# Blackjack
def cards(n):
diff = n - 10
if diff == 10:
return 15
if diff > 11 or diff == 0:
return 0
if n < 10:
return 0
else:
return 4
n = int(input())
print(cards(n))
``` | output | 1 | 7,565 | 19 | 15,131 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, wi... | instruction | 0 | 7,566 | 19 | 15,132 |
Tags: implementation
Correct Solution:
```
n = int(input())
if 1 <= n-10 <= 9 or n-10 == 11:
print("4")
elif n-10 == 10:
print("15")
else:
print("0")
``` | output | 1 | 7,566 | 19 | 15,133 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, wi... | instruction | 0 | 7,567 | 19 | 15,134 |
Tags: implementation
Correct Solution:
```
n = int(input())
if n <= 10 or n > 21:
print(0)
else:
if n == 11 or n == 21:
print(4)
elif n - 10 < 10:
print(4)
else:
print(15)
``` | output | 1 | 7,567 | 19 | 15,135 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, wi... | instruction | 0 | 7,568 | 19 | 15,136 |
Tags: implementation
Correct Solution:
```
n=int(input())
n=n-10
if(n>=1 and n<=9):
print(4)
elif(n==10):
print(15)
elif(n==11):
print(4)
else:
print(0)
``` | output | 1 | 7,568 | 19 | 15,137 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, wi... | instruction | 0 | 7,569 | 19 | 15,138 |
Tags: implementation
Correct Solution:
```
n=int(input())
if 11<=n<=19:
print(4)
elif n==20:
print(15)
elif n==21:
print(4)
else:
print(0)
``` | output | 1 | 7,569 | 19 | 15,139 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, wi... | instruction | 0 | 7,570 | 19 | 15,140 |
Tags: implementation
Correct Solution:
```
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 11, 10] * 4
a = a[:-1]
def solve(n):
print(a.count(n - 10))
n, = map(int, input().split())
solve(n)
``` | output | 1 | 7,570 | 19 | 15,141 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, wi... | instruction | 0 | 7,571 | 19 | 15,142 |
Tags: implementation
Correct Solution:
```
n=int(input())
x=n-10
if(x<=0):
print(0)
else:
if(x>11):
print(0)
elif(x==10):
print(15)
else:
print(4)
``` | output | 1 | 7,571 | 19 | 15,143 |
Provide tags and a correct Python 3 solution for this coding contest problem.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has found one!
Why not make her own Codeforces, wi... | instruction | 0 | 7,572 | 19 | 15,144 |
Tags: implementation
Correct Solution:
```
# import sys
# sys.stdin=open("input.in",'r')
# sys.stdout=open("out.out",'w')
n=int(input())-10
if n<=0:
print(0)
elif n==10:
print(15)
elif n<12:
print(4)
else:
print(0)
``` | output | 1 | 7,572 | 19 | 15,145 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has ... | instruction | 0 | 7,573 | 19 | 15,146 |
Yes | output | 1 | 7,573 | 19 | 15,147 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has ... | instruction | 0 | 7,574 | 19 | 15,148 |
Yes | output | 1 | 7,574 | 19 | 15,149 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has ... | instruction | 0 | 7,575 | 19 | 15,150 |
Yes | output | 1 | 7,575 | 19 | 15,151 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has ... | instruction | 0 | 7,576 | 19 | 15,152 |
Yes | output | 1 | 7,576 | 19 | 15,153 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has ... | instruction | 0 | 7,577 | 19 | 15,154 |
No | output | 1 | 7,577 | 19 | 15,155 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has ... | instruction | 0 | 7,578 | 19 | 15,156 |
No | output | 1 | 7,578 | 19 | 15,157 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has ... | instruction | 0 | 7,579 | 19 | 15,158 |
No | output | 1 | 7,579 | 19 | 15,159 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided to fly over the Mainframe to look for a Great Idea. And she has ... | instruction | 0 | 7,580 | 19 | 15,160 |
No | output | 1 | 7,580 | 19 | 15,161 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Gildong is developing a game consisting of n stages numbered from 1 to n. The player starts the game from the 1-st stage and should beat the stages in increasing order of the stage number. The player wins the game after beating the n-th stag... | instruction | 0 | 7,767 | 19 | 15,534 |
Tags: brute force, constructive algorithms, greedy, math, probabilities
Correct Solution:
```
for _ in range(int(input())):
n = int(input())
a = []
if n % 2 == 1:
print(-1)
continue
if n <= 4000:
print(n // 2)
print('1 ' * (n // 2))
continue
while n > 0:
... | output | 1 | 7,767 | 19 | 15,535 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Gildong is developing a game consisting of n stages numbered from 1 to n. The player starts the game from the 1-st stage and should beat the stages in increasing order of the stage number. The player wins the game after beating the n-th stag... | instruction | 0 | 7,768 | 19 | 15,536 |
Tags: brute force, constructive algorithms, greedy, math, probabilities
Correct Solution:
```
# ------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
... | output | 1 | 7,768 | 19 | 15,537 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Gildong is developing a game consisting of n stages numbered from 1 to n. The player starts the game from the 1-st stage and should beat the stages in increasing order of the stage number. The player wins the game after beating the n-th stag... | instruction | 0 | 7,769 | 19 | 15,538 |
Tags: brute force, constructive algorithms, greedy, math, probabilities
Correct Solution:
```
from sys import stdin
input = stdin.readline
for _ in range(int(input())):
n = int(input())
s = ''
if n % 2:
print(-1)
continue
n //= 2
a = bin(n)[2:]
n = len(a)
for x in range(... | output | 1 | 7,769 | 19 | 15,539 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Gildong is developing a game consisting of n stages numbered from 1 to n. The player starts the game from the 1-st stage and should beat the stages in increasing order of the stage number. The player wins the game after beating the n-th stag... | instruction | 0 | 7,770 | 19 | 15,540 |
Tags: brute force, constructive algorithms, greedy, math, probabilities
Correct Solution:
```
def read_int():
return int(input())
def read_ints():
return map(int, input().split(' '))
t = read_int()
a = [2]
while a[-1] < 1e18:
a.append(a[-1] * 2 + 2)
for case_num in range(t):
n = read_int()
if n ... | output | 1 | 7,770 | 19 | 15,541 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Gildong is developing a game consisting of n stages numbered from 1 to n. The player starts the game from the 1-st stage and should beat the stages in increasing order of the stage number. The player wins the game after beating the n-th stag... | instruction | 0 | 7,771 | 19 | 15,542 |
Tags: brute force, constructive algorithms, greedy, math, probabilities
Correct Solution:
```
t = int(input())
al = [2]
for i in range(100):
al.append(al[-1] * 2 + 2)
#print(al)
for q in range(t):
k = int(input())
if k % 2 == 1:
print(-1)
else:
mas = []
while k > 0:
y = 0
while al[y] <= k:
y += 1
... | output | 1 | 7,771 | 19 | 15,543 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.