commit
88ad5ae3d0
@ -1,3 +0,0 @@
|
|||||||
https://blog.csdn.net/qq_36230375/article/details/134725732
|
|
||||||
|
|
||||||
https://tiku.scratchor.com/paper/view/gjfvsjrgtpm30v3f
|
|
@ -0,0 +1,33 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
const int N = 31;
|
||||||
|
char a[N][N];
|
||||||
|
int n, m, cnt;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cin >> n >> m;
|
||||||
|
|
||||||
|
for (int i = 0; i < n; i++)
|
||||||
|
for (int j = 0; j < m; j++)
|
||||||
|
cin >> a[i][j];
|
||||||
|
|
||||||
|
for (int e = 2; e <= min(m, n); e++) { // 枚举每个小正方形的边长
|
||||||
|
for (int i = 0; i <= n - e; i++) { // 起点i
|
||||||
|
for (int j = 0; j <= m - e; j++) { // 起点j
|
||||||
|
bool f = true;
|
||||||
|
for (int x = 0; x < e; x++) { // 遍历正方形中所有的其它位置,判断是不是与左上角的一致
|
||||||
|
for (int y = 0; y < e; y++) {
|
||||||
|
if (a[i][j] != a[i + x][j + y]) {
|
||||||
|
f = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!f) break;
|
||||||
|
}
|
||||||
|
if (f) cnt++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cout << cnt << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
10
|
||||||
|
1.0 2.3 1.2 1.7 1.1 2.0 1.8 1.8 1.2 1.9
|
@ -0,0 +1,11 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
int main() {
|
||||||
|
int n;
|
||||||
|
cin >> n;
|
||||||
|
n %= 100;
|
||||||
|
n = n - n % 10;
|
||||||
|
n /= 10;
|
||||||
|
cout << n;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
https://ccgao.blog.csdn.net/article/details/134725732
|
@ -0,0 +1,6 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
int main() {
|
||||||
|
cout << '9' * 3 << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
int main() {
|
||||||
|
int b = 0x212;
|
||||||
|
cout << b;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
int main() {
|
||||||
|
int n;
|
||||||
|
cin >> n;
|
||||||
|
cout << n - n / 200 * 25;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
const int N = 10010;
|
||||||
|
int n, mx, pre, nxt;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cin >> n >> pre;
|
||||||
|
for (int i = 2; i <= n; i++) {
|
||||||
|
cin >> nxt;
|
||||||
|
if (abs(nxt - pre) > mx) mx = abs(nxt - pre);
|
||||||
|
pre = nxt;
|
||||||
|
}
|
||||||
|
cout << mx;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int check(int x) {
|
||||||
|
// 转9进制
|
||||||
|
string res;
|
||||||
|
while (x) {
|
||||||
|
int a = x % 9;
|
||||||
|
res += to_string(a);
|
||||||
|
x /= 9;
|
||||||
|
}
|
||||||
|
// 每个数位都是奇数
|
||||||
|
for (int i = 0; i < res.size(); i++)
|
||||||
|
if ((res[i] - '0') % 2 == 0) return 0;
|
||||||
|
|
||||||
|
// 判断转完的9进制是不是回文数
|
||||||
|
// 方法1
|
||||||
|
// string str = res;
|
||||||
|
// reverse(str.begin(), str.end());
|
||||||
|
// return str == res;
|
||||||
|
|
||||||
|
// 方法2
|
||||||
|
for (int i = 0; i < (res.size() + 1) / 2; i++)
|
||||||
|
if (res[i] != res[res.size() - 1 - i]) return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
int main() {
|
||||||
|
int n, m;
|
||||||
|
cin >> n >> m;
|
||||||
|
|
||||||
|
int res = 0;
|
||||||
|
for (int i = n; i <= m; i++) res += check(i);
|
||||||
|
|
||||||
|
cout << res << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
https://ccgao.blog.csdn.net/article/details/134725794
|
||||||
|
|
||||||
|
https://tiku.scratchor.com/paper/view/z8k4y0xsf0ue8xlh
|
Loading…
Reference in new issue