Submission #16494691


Source Code Expand

Copy
from scipy.sparse import *
from scipy.sparse.linalg import *
N,M=map(int,input().split())
G=[[]for _ in range(N)]
D=[0]*N
for _ in range(M):
  a,b=map(int,input().split())
  G[b-1].append(a-1)
  D[a-1]+=1
R,C,V=zip(*([(a,a,1)for a in range(N)]+[(a,b,-0.9/D[b])for a in range(N) for b in G[a]]
))
print(*spsolve(csr_matrix((V,(R,C)),(N,N)),[0.1]*N))

Submission Info

Submission Time
Task E - Page Rank
User maspy
Language Python (3.8.2)
Score 100
Code Size 359 Byte
Status AC
Exec Time 244 ms
Memory 52692 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 25
Set Name Test Cases
All 10_sample_01.txt, 10_sample_02.txt, 20-random_small-00.txt, 20-random_small-01.txt, 20-random_small-02.txt, 20-random_small-03.txt, 20-random_small-04.txt, 20-random_small-05.txt, 20-random_small-06.txt, 20-random_small-07.txt, 20-random_small-08.txt, 20-random_small-09.txt, 30-random_large-00.txt, 30-random_large-01.txt, 30-random_large-02.txt, 30-random_large-03.txt, 30-random_large-04.txt, 30-random_large-05.txt, 30-random_large-06.txt, 30-random_large-07.txt, 30-random_large-08.txt, 30-random_large-09.txt, 40-random_max-00.txt, 40-random_max-01.txt, 40-random_max-02.txt
Case Name Status Exec Time Memory
10_sample_01.txt AC 188 ms 43772 KB
10_sample_02.txt AC 188 ms 44100 KB
20-random_small-00.txt AC 183 ms 44404 KB
20-random_small-01.txt AC 190 ms 44248 KB
20-random_small-02.txt AC 189 ms 44100 KB
20-random_small-03.txt AC 186 ms 44188 KB
20-random_small-04.txt AC 197 ms 43972 KB
20-random_small-05.txt AC 194 ms 43596 KB
20-random_small-06.txt AC 189 ms 44288 KB
20-random_small-07.txt AC 194 ms 44184 KB
20-random_small-08.txt AC 188 ms 44208 KB
20-random_small-09.txt AC 184 ms 43876 KB
30-random_large-00.txt AC 191 ms 43772 KB
30-random_large-01.txt AC 202 ms 44664 KB
30-random_large-02.txt AC 220 ms 50672 KB
30-random_large-03.txt AC 207 ms 49096 KB
30-random_large-04.txt AC 203 ms 45736 KB
30-random_large-05.txt AC 215 ms 47152 KB
30-random_large-06.txt AC 208 ms 45532 KB
30-random_large-07.txt AC 209 ms 47272 KB
30-random_large-08.txt AC 222 ms 50516 KB
30-random_large-09.txt AC 228 ms 51400 KB
40-random_max-00.txt AC 244 ms 52676 KB
40-random_max-01.txt AC 237 ms 52136 KB
40-random_max-02.txt AC 236 ms 52692 KB