当你WA on #6 and #10
查看原帖
当你WA on #6 and #10
996732
Marky_shine楼主2024/8/25 17:14

注意这一句话: s = s + a[i][rgt] - a[i][lft - 1] - a[i - 1][rgt] + a[i - 1][lft - 1];

Please put it to revised to :

s = max(s,0) + a[i][rgt] - a[i][lft - 1] - a[i - 1][rgt] + a[i - 1][lft - 1];

因为面积必须为正! (别问我是怎么知道的)

2024/8/25 17:14
加载中...