Submission #3609837
Source Code Expand
def flpl(): return [float(i) for i in input().split()] def inpl(): return [int(i) for i in input().split()] import numpy as np xs, ys, xt, yt = flpl() rs,rt = 0, 0 N = int(input()) xyr = [(xs, ys, rs),(xt, yt,rt)] + [inpl() for _ in range(N)] X, Y, R = np.array(xyr).T X, Y, R = np.tile(X, (N+2, 1)), np.tile(Y, (N+2, 1)), np.tile(R, (N+2, 1)) edge = np.maximum(np.zeros((N+2, N+2)), np.sqrt(np.square(X-X.T) +\ np.square(Y-Y.T))-(R+R.T)) inf = float('inf') dist = np.array([inf for _ in range(N+2)]) dist[0] = 0 import heapq remain = set(range(N+2)) Q = [] heapq.heappush(Q,(0,0)) while Q: k = heapq.heappop(Q) k = k[1] if k not in remain: continue remain.remove(k) for j in remain: if dist[k] + edge[k][j] < dist[j]: dist[j] = dist[k] + edge[k][j] heapq.heappush(Q,(dist[j],j)) if not remain: break print(dist[1])
Submission Info
Submission Time | |
---|---|
Task | E - Cosmic Rays |
User | Tallfall |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 942 Byte |
Status | TLE |
Exec Time | 2111 ms |
Memory | 70692 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 600 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
All | 0_00.txt, 0_01.txt, 0_02.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, 1_20.txt, 1_21.txt, 1_22.txt, 1_23.txt, 1_24.txt, 1_25.txt, 1_26.txt, 1_27.txt, 1_28.txt, 1_29.txt, 1_30.txt, 1_31.txt, 1_32.txt, 1_33.txt, 1_34.txt, 1_35.txt, 1_36.txt, 1_37.txt, 1_38.txt, 1_39.txt, 1_40.txt, 1_41.txt, 1_42.txt, 1_43.txt, 1_44.txt, 1_45.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 1422 ms | 16484 KB |
0_01.txt | AC | 148 ms | 12196 KB |
0_02.txt | AC | 147 ms | 12196 KB |
1_00.txt | AC | 147 ms | 12196 KB |
1_01.txt | AC | 147 ms | 12196 KB |
1_02.txt | AC | 666 ms | 57720 KB |
1_03.txt | AC | 675 ms | 58364 KB |
1_04.txt | AC | 622 ms | 58432 KB |
1_05.txt | AC | 637 ms | 58992 KB |
1_06.txt | AC | 635 ms | 58080 KB |
1_07.txt | AC | 678 ms | 57980 KB |
1_08.txt | AC | 667 ms | 58364 KB |
1_09.txt | AC | 673 ms | 58812 KB |
1_10.txt | AC | 655 ms | 59132 KB |
1_11.txt | AC | 672 ms | 58076 KB |
1_12.txt | AC | 678 ms | 57944 KB |
1_13.txt | AC | 620 ms | 58916 KB |
1_14.txt | AC | 707 ms | 59248 KB |
1_15.txt | AC | 704 ms | 59540 KB |
1_16.txt | AC | 681 ms | 59132 KB |
1_17.txt | AC | 716 ms | 58700 KB |
1_18.txt | AC | 699 ms | 58268 KB |
1_19.txt | AC | 711 ms | 59248 KB |
1_20.txt | AC | 636 ms | 59016 KB |
1_21.txt | AC | 644 ms | 57604 KB |
1_22.txt | AC | 695 ms | 58992 KB |
1_23.txt | AC | 701 ms | 58992 KB |
1_24.txt | AC | 708 ms | 59248 KB |
1_25.txt | AC | 650 ms | 58364 KB |
1_26.txt | AC | 676 ms | 58768 KB |
1_27.txt | AC | 631 ms | 57492 KB |
1_28.txt | AC | 654 ms | 58924 KB |
1_29.txt | AC | 641 ms | 59020 KB |
1_30.txt | AC | 642 ms | 58376 KB |
1_31.txt | AC | 652 ms | 59016 KB |
1_32.txt | AC | 680 ms | 59132 KB |
1_33.txt | AC | 653 ms | 57884 KB |
1_34.txt | AC | 612 ms | 57492 KB |
1_35.txt | AC | 647 ms | 59248 KB |
1_36.txt | AC | 615 ms | 59208 KB |
1_37.txt | AC | 639 ms | 58376 KB |
1_38.txt | TLE | 2111 ms | 70656 KB |
1_39.txt | TLE | 2111 ms | 70656 KB |
1_40.txt | TLE | 2111 ms | 68712 KB |
1_41.txt | TLE | 2110 ms | 70692 KB |
1_42.txt | AC | 669 ms | 57604 KB |
1_43.txt | AC | 707 ms | 59248 KB |
1_44.txt | AC | 640 ms | 59020 KB |
1_45.txt | AC | 707 ms | 58812 KB |