ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#201712 | #3515. apsp | Josephcheng | 100 | 126ms | 1360kb | C++11 | 463b | 2024-02-05 09:24:19 | 2024-02-05 12:20:25 |
answer
#include<bits/stdc++.h>
using namespace std;
int n;
int dis[205][205];
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
scanf("%d",&dis[i][j]);
for(int k=1;k<=n;k++)
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++)
if(dis[i][k]<=dis[i][j]&&dis[k][j]<=dis[i][j])
dis[i][j]=max(dis[i][k],dis[k][j]);
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++)
printf("%d ",dis[i][j]);
if(i<n) puts("");
}
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1216kb
input:
20 0 439509780 342965464 60373 411700507 837981274 572068349 921154360 260313961 92402031 437596400 ...
output:
0 46353022 24436665 60373 65159666 65159666 24436665 65159666 65159666 29543073 123266118 65159666 1...
result:
ok 20 lines
Test #2:
score: 10
Accepted
time: 0ms
memory: 1212kb
input:
20 0 285442530 325746538 273119460 598013395 50430837 93643196 252680984 993784685 52643825 77465363...
output:
0 77733801 50430837 77733801 77733801 50430837 93643196 55960654 61635002 50430837 50430837 55960654...
result:
ok 20 lines
Test #3:
score: 10
Accepted
time: 0ms
memory: 1216kb
input:
20 0 676794439 655011283 723848263 74215811 390830989 98495210 68312731 568855866 498122 197826613 7...
output:
0 44197424 44197424 58529348 44197424 44197424 98495210 28266642 44197424 498122 49448028 44197424 4...
result:
ok 20 lines
Test #4:
score: 10
Accepted
time: 0ms
memory: 1240kb
input:
50 0 845739613 854356988 209603629 760761049 364620233 972952794 58783934 466565291 659917485 539359...
output:
0 24754075 29030863 25613848 24754075 24754075 24754075 24754075 24754075 24754075 24754075 29470373...
result:
ok 50 lines
Test #5:
score: 10
Accepted
time: 1ms
memory: 1240kb
input:
50 0 112512026 380214710 105237383 619234346 542336786 577636937 870754131 42067473 990598102 921370...
output:
0 24180162 24180162 24180162 24180162 25383165 24180162 24180162 24180162 24180162 24180162 24180162...
result:
ok 50 lines
Test #6:
score: 10
Accepted
time: 26ms
memory: 1360kb
input:
200 0 916372650 593280641 742096163 168880655 752594911 148538429 719049348 25775230 395581904 96946...
output:
0 3358962 8781151 10083322 5487764 3941084 3358962 3014591 4054931 5021939 3014591 3014591 4054931 3...
result:
ok 200 lines
Test #7:
score: 10
Accepted
time: 24ms
memory: 1356kb
input:
200 0 539934047 212795217 594185880 49083486 27806013 479866865 327233646 58568403 880756947 7044427...
output:
0 5931195 5931195 6649052 6226656 5931195 5931195 5931195 4650486 5931195 5931195 5931195 7426161 59...
result:
ok 200 lines
Test #8:
score: 10
Accepted
time: 26ms
memory: 1360kb
input:
200 0 364363983 571365084 703224764 371266539 766847728 319005885 149660486 867428779 126718355 9632...
output:
0 9002510 9002510 9002510 9002510 9002510 9002510 9002510 9002510 9002510 9002510 9002510 9002510 90...
result:
ok 200 lines
Test #9:
score: 10
Accepted
time: 25ms
memory: 1360kb
input:
200 0 105306283 116816969 452963565 38735375 388893957 150978854 726783436 806229437 967584383 96291...
output:
0 4921513 5486529 3745273 4390047 4504003 3745273 2855168 3745273 5486529 3745273 3745273 3745273 47...
result:
ok 200 lines
Test #10:
score: 10
Accepted
time: 24ms
memory: 1356kb
input:
200 0 822687200 805257213 739257801 530763102 382482126 9995508 688365055 361582848 736721222 711695...
output:
0 9995508 10509674 9995508 9995508 9995508 9995508 9995508 9995508 9995508 9995508 9995508 9995508 9...
result:
ok 200 lines