题目描述
Due to recent rains, water has pooled in various places in Farmer Johns field, which is represented by a rectangle of N x M (1 < N < 100; 1 < M < 100) squares. Each square contains either water (W) or dry land (.). Farmer John would l…
好啊,很好啊.
关键点:
1.注意上下界的判断,x要 > 1开头的等差d 1的序列 < k - n 1开头的等差d 1的序列
这里有个细节 原来应该是 x < n * (2 * k - n 1) / 2
但k,x的范围是1e14,这样就爆long long,所以得是x * 2 / n < 2 * k - n 1
2.直接看代码的实现…