正文
增加 6 行删除 6 行
1234565 行未改动7172737475767778798081828384858630 行未改动我太菜了,花了两个多小时才搞明白 🏳稍微记录一下防止以后看不懂自己写的啥了。---65 行未改动pair<int, int> calc(int s, int t, int cur, int k, int i) {// 四个式子其实只有符号上的差异,于是我们可以偷点懒(其实可以直接传正负号的int nd = t - (cur + k * i);if (s > 0) {if (nd > 0) return {(nd + s - 1) / s, 1e18};else return {0, 1e18};} else if (s < 0) {if (nd > 0) return {1e18, -1e18};else return {0, nd / s};} else {if (nd <= 0) return {0, 1e18};else return {1e18, -1e18};}}signed main() {ios::sync_with_stdio(0); cin.tie(0);30 行未改动1234565 行未改动7172737475767778798081828384858630 行未改动我太菜了,花了两个多小时才搞明白 🏳稍微记录一下防止以后看不懂自己写的啥了。---65 行未改动pair<int, int> calc(int s, int t, int cur, int k, int i) {// 四个式子其实只有符号上的差异,于是我们可以偷点懒(其实可以直接传正负号的int nd = t - (cur + k * i);if (s > 0) {if (nd > 0) return {(nd + s - 1) / s, 1e18};else return {0, 1e18};} else if (s < 0) {if (nd > 0) return {1e18, -1e18};else return {0, nd / s};} else {if (nd <= 0) return {0, 1e18};else return {1e18, -1e18};}}signed main() {ios::sync_with_stdio(0); cin.tie(0);30 行未改动