Submission #3012760
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 for x in ans: print(x)
Submission Info
Submission Time | |
---|---|
Task | B - Median Pyramid Easy |
User | tnyo43 |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 879 Byte |
Status | WA |
Exec Time | 223 ms |
Memory | 12600 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
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 | WA | 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 | 223 ms | 12472 KB |
1_10.txt | AC | 216 ms | 12472 KB |
1_11.txt | AC | 222 ms | 12472 KB |
1_12.txt | AC | 220 ms | 12472 KB |
1_13.txt | AC | 216 ms | 12600 KB |
1_14.txt | AC | 17 ms | 3064 KB |
1_15.txt | AC | 17 ms | 3064 KB |
1_16.txt | AC | 139 ms | 8564 KB |
1_17.txt | AC | 223 ms | 12276 KB |
1_18.txt | AC | 100 ms | 7028 KB |
1_19.txt | AC | 17 ms | 3064 KB |