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 |
|---|---|---|---|---|---|
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns,... | instruction | 0 | 62,661 | 19 | 125,322 |
Yes | output | 1 | 62,661 | 19 | 125,323 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns,... | instruction | 0 | 62,662 | 19 | 125,324 |
Yes | output | 1 | 62,662 | 19 | 125,325 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns,... | instruction | 0 | 62,663 | 19 | 125,326 |
Yes | output | 1 | 62,663 | 19 | 125,327 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns,... | instruction | 0 | 62,664 | 19 | 125,328 |
Yes | output | 1 | 62,664 | 19 | 125,329 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns,... | instruction | 0 | 62,665 | 19 | 125,330 |
No | output | 1 | 62,665 | 19 | 125,331 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns,... | instruction | 0 | 62,666 | 19 | 125,332 |
No | output | 1 | 62,666 | 19 | 125,333 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns,... | instruction | 0 | 62,667 | 19 | 125,334 |
No | output | 1 | 62,667 | 19 | 125,335 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Sereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number, all numbers on the cards are distinct. The players take turns,... | instruction | 0 | 62,668 | 19 | 125,336 |
No | output | 1 | 62,668 | 19 | 125,337 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It turns out that you are a great fan of rock band AC/PE. Peter learned that and started the following game: he plays the first song of the list of n songs of the group, and you have to find out... | instruction | 0 | 62,720 | 19 | 125,440 |
No | output | 1 | 62,720 | 19 | 125,441 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It turns out that you are a great fan of rock band AC/PE. Peter learned that and started the following game: he plays the first song of the list of n songs of the group, and you have to find out... | instruction | 0 | 62,721 | 19 | 125,442 |
No | output | 1 | 62,721 | 19 | 125,443 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It turns out that you are a great fan of rock band AC/PE. Peter learned that and started the following game: he plays the first song of the list of n songs of the group, and you have to find out... | instruction | 0 | 62,722 | 19 | 125,444 |
No | output | 1 | 62,722 | 19 | 125,445 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
It turns out that you are a great fan of rock band AC/PE. Peter learned that and started the following game: he plays the first song of the list of n songs of the group, and you have to find out... | instruction | 0 | 62,723 | 19 | 125,446 |
No | output | 1 | 62,723 | 19 | 125,447 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a and Lexa starts with score b. In a single turn, both Memory and Lexa get some integer in the range [ - k;k] (i.e. one integ... | instruction | 0 | 62,777 | 19 | 125,554 |
Tags: combinatorics, dp, math
Correct Solution:
```
mod=10**9+7
f=[0]*500000
def POW(a,b):
if(b==0):
return 1
if(b&1):
return POW(a,b//2)**2*a%mod
else:
return POW(a,b//2)**2
def C(n,m):
if(m>n):
return 0
t=f[n]*POW(f[m],mod-2)%mod*POW(f[n-m],mod-2)%mod
return t
f[0]=1
for i in range(1,500000):
f[i]=... | output | 1 | 62,777 | 19 | 125,555 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a and Lexa starts with score b. In a single turn, both Memory and Lexa get some integer in the range [ - k;k] (i.e. one integ... | instruction | 0 | 62,778 | 19 | 125,556 |
Tags: combinatorics, dp, math
Correct Solution:
```
def c(n, k):
if k > n:
return 0
a = b = 1
for i in range(n - k + 1, n + 1):
a *= i
for i in range(1, k + 1):
b *= i
return a // b
a, b, k, t = map(int, input().split())
n, m, s = 2 * k + 1, 2 * t, 2 * k * t + b - a
ans, mod = 0, 1000000007
for i in range(m ... | output | 1 | 62,778 | 19 | 125,557 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a and Lexa starts with score b. In a single turn, both Memory and Lexa get som... | instruction | 0 | 62,779 | 19 | 125,558 |
No | output | 1 | 62,779 | 19 | 125,559 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score a and Lexa starts with score b. In a single turn, both Memory and Lexa get som... | instruction | 0 | 62,780 | 19 | 125,560 |
No | output | 1 | 62,780 | 19 | 125,561 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In this task Anna and Maria play the following game. Initially they have a checkered piece of paper with a painted n Γ m rectangle (only the border, no filling). Anna and Maria move in turns and... | instruction | 0 | 63,264 | 19 | 126,528 |
No | output | 1 | 63,264 | 19 | 126,529 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In this task Anna and Maria play the following game. Initially they have a checkered piece of paper with a painted n Γ m rectangle (only the border, no filling). Anna and Maria move in turns and... | instruction | 0 | 63,265 | 19 | 126,530 |
No | output | 1 | 63,265 | 19 | 126,531 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In this task Anna and Maria play the following game. Initially they have a checkered piece of paper with a painted n Γ m rectangle (only the border, no filling). Anna and Maria move in turns and... | instruction | 0 | 63,266 | 19 | 126,532 |
No | output | 1 | 63,266 | 19 | 126,533 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
In this task Anna and Maria play the following game. Initially they have a checkered piece of paper with a painted n Γ m rectangle (only the border, no filling). Anna and Maria move in turns and... | instruction | 0 | 63,267 | 19 | 126,534 |
No | output | 1 | 63,267 | 19 | 126,535 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is located at position (1,1) with score a_{1,1}.
To... | instruction | 0 | 63,268 | 19 | 126,536 |
Tags: bitmasks, constructive algorithms, math
Correct Solution:
```
# https://codeforces.com/contest/1332/problem/D
k=int(input())
y=1
while y<=k:
y<<=1
X=k+y
m=[[X,y,y],
[k,y,y],
[k,X,k]]
print(3, 3)
for arr in m:
print(' '.join([str(x) for x in arr]))
``` | output | 1 | 63,268 | 19 | 126,537 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is located at position (1,1) with score a_{1,1}.
To... | instruction | 0 | 63,269 | 19 | 126,538 |
Tags: bitmasks, constructive algorithms, math
Correct Solution:
```
k = int(input())
print(3,4)
print(262143, k, k, 0)
print(131072, 0, k, 0)
print(131072, 131072, 262143, 131071)
``` | output | 1 | 63,269 | 19 | 126,539 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is located at position (1,1) with score a_{1,1}.
To... | instruction | 0 | 63,270 | 19 | 126,540 |
Tags: bitmasks, constructive algorithms, math
Correct Solution:
```
k=int(input())
if(k==0):
print(1,1)
print(1)
exit(0)
q=bin(100000)
t=pow(2,len(q)-1)-1
rem=bin(k)
rem=rem[2::]
rem='0'*(len(bin(t))-2-len(rem))+(rem)
alpha=0
for i in range(len(rem)):
if(rem[i]=='0'):
alpha+=pow(2,le... | output | 1 | 63,270 | 19 | 126,541 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is located at position (1,1) with score a_{1,1}.
To... | instruction | 0 | 63,271 | 19 | 126,542 |
Tags: bitmasks, constructive algorithms, math
Correct Solution:
```
k = int(input())
b = k.bit_length()
all_1 = (1<<(b+1)) - 1
first_1 = 1<<b
other_1 = first_1 - 1
a = [
[all_1, first_1, 0],
[other_1, all_1, k],
]
print(2, 3)
for row in a: print(*row)
``` | output | 1 | 63,271 | 19 | 126,543 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is located at position (1,1) with score a_{1,1}.
To... | instruction | 0 | 63,272 | 19 | 126,544 |
Tags: bitmasks, constructive algorithms, math
Correct Solution:
```
k = int(input())
x = 1
while x <= k:
x *= 2
x1 = x * 2 - 1
print(3, 3)
print(x1, x, 0)
print(k, x1, x - 1)
print(0, x - 1, x1)
``` | output | 1 | 63,272 | 19 | 126,545 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is located at position (1,1) with score a_{1,1}.
To... | instruction | 0 | 63,273 | 19 | 126,546 |
Tags: bitmasks, constructive algorithms, math
Correct Solution:
```
k = int(input())
pow2 = 0
pow2x = 1
while pow2x <= k * 2:
pow2 += 1
pow2x *= 2
one = pow2x - 1
zer = pow2x // 2
kek = k
ans = \
[
[one, one, one, one, zer],
[one, 0, one, kek, zer],
[one, one, 0, kek, one],
... | output | 1 | 63,273 | 19 | 126,547 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is located at position (1,1) with score a_{1,1}.
To... | instruction | 0 | 63,274 | 19 | 126,548 |
Tags: bitmasks, constructive algorithms, math
Correct Solution:
```
k = int(input())
print(2, 3)
print(pow(2, 18) - 1, k, 0)
print(pow(2, 17), pow(2, 18) - 1, k)
``` | output | 1 | 63,274 | 19 | 126,549 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is located at position (1,1) with score a_{1,1}.
To... | instruction | 0 | 63,275 | 19 | 126,550 |
Tags: bitmasks, constructive algorithms, math
Correct Solution:
```
from bisect import bisect_left as bl, bisect_right as br, insort
import sys
import heapq
#from math import *
from collections import defaultdict as dd, deque
def data(): return sys.stdin.readline().strip()
def mdata(): return map(int, data().split(... | output | 1 | 63,275 | 19 | 126,551 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,276 | 19 | 126,552 |
Yes | output | 1 | 63,276 | 19 | 126,553 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,277 | 19 | 126,554 |
Yes | output | 1 | 63,277 | 19 | 126,555 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,278 | 19 | 126,556 |
Yes | output | 1 | 63,278 | 19 | 126,557 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,279 | 19 | 126,558 |
Yes | output | 1 | 63,279 | 19 | 126,559 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,280 | 19 | 126,560 |
No | output | 1 | 63,280 | 19 | 126,561 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,281 | 19 | 126,562 |
No | output | 1 | 63,281 | 19 | 126,563 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,282 | 19 | 126,564 |
No | output | 1 | 63,282 | 19 | 126,565 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,283 | 19 | 126,566 |
No | output | 1 | 63,283 | 19 | 126,567 |
Evaluate the correctness of the submitted Python 2 solution to the coding contest problem. Provide a "Yes" or "No" response.
Bob is playing a game named "Walk on Matrix".
In this game, player is given an n Γ m matrix A=(a_{i,j}), i.e. the element in the i-th row in the j-th column is a_{i,j}. Initially, player is loc... | instruction | 0 | 63,284 | 19 | 126,568 |
No | output | 1 | 63,284 | 19 | 126,569 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1 and bottom card β index n. Each card has its color: the i-th card has color a_i.
You should process ... | instruction | 0 | 63,378 | 19 | 126,756 |
Yes | output | 1 | 63,378 | 19 | 126,757 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1 and bottom card β index n. Each card has its color: the i-th card has color a_i.
You should process ... | instruction | 0 | 63,379 | 19 | 126,758 |
Yes | output | 1 | 63,379 | 19 | 126,759 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1 and bottom card β index n. Each card has its color: the i-th card has color a_i.
You should process ... | instruction | 0 | 63,380 | 19 | 126,760 |
Yes | output | 1 | 63,380 | 19 | 126,761 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1 and bottom card β index n. Each card has its color: the i-th card has color a_i.
You should process ... | instruction | 0 | 63,381 | 19 | 126,762 |
Yes | output | 1 | 63,381 | 19 | 126,763 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1 and bottom card β index n. Each card has its color: the i-th card has color a_i.
You should process ... | instruction | 0 | 63,382 | 19 | 126,764 |
No | output | 1 | 63,382 | 19 | 126,765 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1 and bottom card β index n. Each card has its color: the i-th card has color a_i.
You should process ... | instruction | 0 | 63,383 | 19 | 126,766 |
No | output | 1 | 63,383 | 19 | 126,767 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1 and bottom card β index n. Each card has its color: the i-th card has color a_i.
You should process ... | instruction | 0 | 63,384 | 19 | 126,768 |
No | output | 1 | 63,384 | 19 | 126,769 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a card deck of n cards, numbered from top to bottom, i. e. the top card has index 1 and bottom card β index n. Each card has its color: the i-th card has color a_i.
You should process ... | instruction | 0 | 63,385 | 19 | 126,770 |
No | output | 1 | 63,385 | 19 | 126,771 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nauuo is a girl who loves playing cards.
One day she was playing cards but found that the cards were mixed with some empty ones.
There are n cards numbered from 1 to n, and they were mixed with another n empty cards. She piled up the 2n ca... | instruction | 0 | 64,048 | 19 | 128,096 |
Tags: greedy, implementation
Correct Solution:
```
n = int(input())
*hand, = map(int, input().split())
*pile, = map(int, input().split())
dist = [0]*(n+1)
# Should return 2
# n = 3
# hand = [0, 2, 0]
# pile = [3, 0, 1]
# dist = [0]*(n+1)
# Should return 6
# n = 3
# hand = [0, 0, 0]
# pile = [2, 3, 1]
# dist = [0]*(n+... | output | 1 | 64,048 | 19 | 128,097 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nauuo is a girl who loves playing cards.
One day she was playing cards but found that the cards were mixed with some empty ones.
There are n cards numbered from 1 to n, and they were mixed with another n empty cards. She piled up the 2n ca... | instruction | 0 | 64,049 | 19 | 128,098 |
Tags: greedy, implementation
Correct Solution:
```
from copy import deepcopy
import heapq
def main():
buf = input()
n = int(buf)
buf = input()
buflist = buf.split()
a = set(map(int, buflist))
buf = input()
buflist = buf.split()
b = list(map(int, buflist))
if 0 in a:
a.remove... | output | 1 | 64,049 | 19 | 128,099 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nauuo is a girl who loves playing cards.
One day she was playing cards but found that the cards were mixed with some empty ones.
There are n cards numbered from 1 to n, and they were mixed with another n empty cards. She piled up the 2n ca... | instruction | 0 | 64,050 | 19 | 128,100 |
Tags: greedy, implementation
Correct Solution:
```
import sys
input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
table = [0] * (N + 1)
for i in range(N):
if b[i]: table[b[i]] = i + 1
#print(table)
last = N - table[1] + 1
islast = 1
if table[1] == 0:
l... | output | 1 | 64,050 | 19 | 128,101 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nauuo is a girl who loves playing cards.
One day she was playing cards but found that the cards were mixed with some empty ones.
There are n cards numbered from 1 to n, and they were mixed with another n empty cards. She piled up the 2n ca... | instruction | 0 | 64,051 | 19 | 128,102 |
Tags: greedy, implementation
Correct Solution:
```
n=int(input())
a=[int(v) for v in input().split()]
b=[int(v) for v in input().split()]
c=0
d={}
f=0
for j in range(n):
d[a[j]]=1
j=n-1
while j>0:
if b[j]==b[j-1]+1 and b[j]!=1:
j=j-1
#print(j)
else:
break
#print(j)
if b[j]==1 and j>0... | output | 1 | 64,051 | 19 | 128,103 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Nauuo is a girl who loves playing cards.
One day she was playing cards but found that the cards were mixed with some empty ones.
There are n cards numbered from 1 to n, and they were mixed with another n empty cards. She piled up the 2n ca... | instruction | 0 | 64,052 | 19 | 128,104 |
Tags: greedy, implementation
Correct Solution:
```
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
f = True
if 1 in b:
j = b.index(1)
for i in range(n - j):
d = i + 1 - b[j + i]
if d != 0:
break
else:
s = -2
for k in range(... | output | 1 | 64,052 | 19 | 128,105 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.