Submission #11300102


Source Code Expand

Copy
#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np
N, X, Y = map(int, read().split())

dist = []
for i in range(1, N):
    x = np.arange(i + 1, N + 1)
    # 直接
    d1 = np.abs(x - i)
    # i -> X -> Y -> x
    d2 = np.abs(i - X) + np.abs(Y - x) + 1
    # i -> Y -> X -> x
    d3 = np.abs(i - Y) + np.abs(X - x) + 1
    d = np.minimum(np.minimum(d1, d2), d3)
    dist.append(d)

dist = np.concatenate(dist)
count = np.bincount(dist, minlength=N)
print('\n'.join(count[1:].astype(str)))

Submission Info

Submission Time
Task D - Line++
User maspy
Language Python (3.4.3)
Score 400
Code Size 618 Byte
Status AC
Exec Time 257 ms
Memory 43896 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 4
AC × 17
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_small_01.txt, 01_small_02.txt, 01_small_03.txt, 01_small_04.txt, 01_small_05.txt, 02_large_01.txt, 02_large_02.txt, 02_large_03.txt, 02_large_04.txt, 02_large_05.txt, 03_hand_01.txt, 03_hand_02.txt, 03_hand_03.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 148 ms 12424 KB
00_sample_02.txt AC 146 ms 12424 KB
00_sample_03.txt AC 150 ms 12424 KB
00_sample_04.txt AC 149 ms 12424 KB
01_small_01.txt AC 149 ms 12424 KB
01_small_02.txt AC 150 ms 12424 KB
01_small_03.txt AC 150 ms 12424 KB
01_small_04.txt AC 153 ms 12424 KB
01_small_05.txt AC 150 ms 12424 KB
02_large_01.txt AC 257 ms 43768 KB
02_large_02.txt AC 253 ms 41976 KB
02_large_03.txt AC 253 ms 42616 KB
02_large_04.txt AC 250 ms 43000 KB
02_large_05.txt AC 252 ms 43768 KB
03_hand_01.txt AC 250 ms 43896 KB
03_hand_02.txt AC 251 ms 43896 KB
03_hand_03.txt AC 255 ms 43896 KB