@[Caterpie_771](/user/838232) `RE` 原因:数据行尾有 `\r`,另外
```python
m = input()
for j in m:
if j != " " and j != "0":
dir[i + 1].append(int(j))
```
你这个读入似乎是按照字符分解的吧,可以改成
```python
m = input().split()
for j in m:
dir[i + 1].append(int(j))
```
另外读入一行数据的格式是
```python
l=list(map(int,input().split()))
```
by Terrible @ 2023-06-05 12:33:27
@[Terrible](/user/195942) 感谢大佬!
by Caterpie_771 @ 2023-06-06 20:17:13