R1:
interfaceGigabitEthernet0/0/1
ip address 13.1.1.1255.255.255.0interfaceSerial1/0/0
ip address 12.1.1.1255.255.255.0
#
R2:
interfaceGigabitEthernet0/0/1
ip address 24.1.1.2255.255.255.0interfaceSerial1/0/0
ip address 12.1.1.2255.255.255.0
#
R3:interfaceGigabitEthernet0/0/0
ip address 13.1.1.3255.255.255.0interfaceGigabitEthernet0/0/1
ip address 35.1.1.3255.255.255.0
#
R4:interfaceGigabitEthernet0/0/0
ip address 24.1.1.4255.255.255.0interfaceGigabitEthernet0/0/1
ip address 45.1.1.4255.255.255.0
#
R5:interfaceGigabitEthernet0/0/0
ip address 35.1.1.5255.255.255.0interfaceGigabitEthernet0/0/1
ip address 45.1.1.5255.255.255.0interfaceLoopBack0
ip address 5.5.5.5255.255.255.255
2.R1/2/3/4运行OSPF
2.1 进程号为1,RID如下:
R1:1.1.1.1
R2:2.2.2.2
R3:3.3.3.3
R4:4.4.4.4
2.2 所有路由器属于区域0
2.3 全部使用通配符0.0.0.0通告。
2.4 确认各路由器之间的邻居关系。
R1:
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 12.1.1.10.0.0.0
network 13.1.1.10.0.0.0R2:
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 12.1.1.20.0.0.0
network 24.1.1.20.0.0.0R3:
ospf 1 router-id 3.3.3.3
area 0.0.0.0
network 13.1.1.30.0.0.0R4:
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 24.1.1.40.0.0.0
题目 题解
class Solution:def rob(self, nums: List[int]) -> int:N len(nums)# 定义状态: dp[i]表示从第i间房子开始抢劫,最多能抢到的金额dp [0 for i in range(N)]for i in range(N-1, -1, -1):if i N-1:dp[i] nums[i]elif i N-2:dp[i] max(nums[i], …