C. New Year and Domino They say "years are like dominoes, tumbling one after the other". But would a year fit into a grid? I don't think so. Limak is a little polar bear who loves to play. He has recently got a rectangular grid with h rows and…
C. New Year and Domino time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output They say "years are like dominoes, tumbling one after the other". But would a year fit into a grid? I don't thin…
题目链接: I. Special Squares There are some points and lines parellel to x-axis or y-axis on the plane. If arbitrary chosen two lines parallel to x-axis and two lines parallel to y-axis, one rectangle, or sometimes a square, will be formed. If a square i…
思路:就是使用二维前缀和的模板: 先放模板: #include<iostream> using namespace std; #define ll long long ; ll a[maxn][maxn], jx[maxn][maxn]; ll n, m, L, xa, ya, xb, yb; ll aa, bb, maxx = ; int main(){ cin >> n >> m>>L; ; i <= n;++i) ; j <= m; ++j…