Files
python/LuoGu/RuMen/P1548.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

14 lines
555 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include<bits/stdc++.h>
using namespace std;
int m, n, z, c, i, j, k, l; //z用来记正方形个数c来记长方形
int main() {
cin >> m >> n; //输入
for (i = 0; i <= m; i++) //枚举
for (j = 0; j <= n; j++) //枚举
for (k = i + 1; k <= m; k++) //还是枚举
for (l = j + 1; l <= n; l++) //仍然是枚举
if (k - i == l - j)z++; //是正方形
else c++; //是长方形
cout << z << " " << c; //输出
}