我去下载了一个样例来看,自测发现并没有问题:
```
input
5 18
2 4 276
3 3 435
3 4 608
2 4 860
1 2 318
1 3 547
5 4 419
2 5 98
1 5 460
5 3 399
3 5 240
3 2 733
3 3 903
4 2 909
5 2 206
3 4 810
2 1 115
2 3 419
```
```
output:
729
```
[测试记录](https://www.luogu.com.cn/record/115092997)
by GGapa @ 2023-07-12 15:58:21
@[GGapa](/user/597060) 是测试点1
by GGapa @ 2023-07-12 16:01:27
@[GGapa](/user/597060) 你洛谷在线IDE试试
by FTR_CLCX @ 2023-07-12 16:03:10
@[GGapa](/user/597060) 本地和洛谷评测机输出有可能不同
by FTR_CLCX @ 2023-07-12 16:03:48
@[GGapa](/user/597060) 快读写错了
by 六楼溜刘 @ 2023-07-12 16:04:06
@[GGapa](/user/597060) 看看我的
by 六楼溜刘 @ 2023-07-12 16:04:20
```cpp
#define gc getchar()
inline int read(){
int x=0,f=1;char c;
while(!isdigit(c=gc)) if(c=='-') f=-1;
while(isdigit(c)){x=(x<<3)+(x<<1)+(c^48);c=gc;}
return x*f;
}
#undef gc
```
by 六楼溜刘 @ 2023-07-12 16:04:45
你把空字符(比如换行 `\n`)当数字读了,但 Windows 默认忽略空字符,Linux 不会忽略
by 六楼溜刘 @ 2023-07-12 16:07:11
所以你本地没问题传上去有问题
by 六楼溜刘 @ 2023-07-12 16:08:33
@[六楼溜刘](/user/537230) 别人大括号要还行,不如我的
```cpp
inline int rd()
{
int x=0,f=1;char c=getchar();
for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
for(; isdigit(c);c=getchar()) x=(x<<3)+(x<<1)+(c^48);
return x*f;
}
```
by spider_oyster @ 2023-07-12 16:20:24