Submission #3012782


Source Code Expand

n, x = map(int, input().split())


def calc(a):
    b = []
    for i in range(len(a)-2):
        b.append(list(sorted(a[i:i+3]))[1])
    if len(b) == 1:
        return b[0]
    else:
        return calc(b)
"""
n = 5
max_ = []
for i in range(n):
    max_.append(i*2+1)

for i in range(n-1, 0, -1):
    max_.append(i*2)

print(calc(max_))
"""

if x == 1 or x == 2*n-1:
    print("No")
    exit()
print("Yes")

if x == 2:
    center = 2
    r1 = 1
    r2 = 3
    l = 4
else:
    center = x
    r1 = x+1
    r2 = 1
    l = 2

ans = []
y = 1
for i in range(n-2):
    while y in [center, r1, r2, l]:
        y+= 1
    ans.append(y)
    y+=1
ans.append(l)
ans.append(center)
ans.append(r1)
ans.append(r2)
for i in range(n-3):
    while y in [center, r1, r2, l]:
        y+=1
    ans.append(y)
    y+=1
if n == 2:
    ans = [1,2,3]
for x in ans:
    print(x)

Submission Info

Submission Time
Task B - Median Pyramid Easy
User tnyo43
Language Python (3.4.3)
Score 400
Code Size 910 Byte
Status AC
Exec Time 256 ms
Memory 12472 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 22
Set Name Test Cases
Sample 0_00.txt, 0_01.txt
All 0_00.txt, 0_01.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt
Case Name Status Exec Time Memory
0_00.txt AC 17 ms 3064 KB
0_01.txt AC 17 ms 3064 KB
1_00.txt AC 17 ms 3064 KB
1_01.txt AC 17 ms 3064 KB
1_02.txt AC 17 ms 3064 KB
1_03.txt AC 17 ms 3064 KB
1_04.txt AC 17 ms 3064 KB
1_05.txt AC 17 ms 3064 KB
1_06.txt AC 17 ms 3064 KB
1_07.txt AC 17 ms 3064 KB
1_08.txt AC 17 ms 3064 KB
1_09.txt AC 217 ms 12472 KB
1_10.txt AC 220 ms 12472 KB
1_11.txt AC 217 ms 12472 KB
1_12.txt AC 214 ms 12472 KB
1_13.txt AC 222 ms 12472 KB
1_14.txt AC 17 ms 3064 KB
1_15.txt AC 17 ms 3064 KB
1_16.txt AC 142 ms 8564 KB
1_17.txt AC 256 ms 12276 KB
1_18.txt AC 116 ms 7028 KB
1_19.txt AC 17 ms 3064 KB