0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 14:56:27 +00:00

#6256. 「CodePlus 2017 12 月赛」可做题1

https://loj.ac/s/1634694
This commit is contained in:
Baoshuo Ren 2022-11-17 15:26:55 +08:00
parent 7f6a4e3271
commit 0684ac736e
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
21 changed files with 109 additions and 0 deletions

49
LibreOJ/6256/6256.cpp Normal file
View File

@ -0,0 +1,49 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 505;
int n, m, t, a[N][N], s[N][N];
bool g[N][N];
int sum(int x1, int y1, int x2, int y2) {
return s[x2][y2] - s[x1 - 1][y2] - s[x2][y1 - 1] + s[x1 - 1][y1 - 1];
}
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n >> m >> t;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cin >> a[i][j];
}
}
for (int i = 1; i < n; i++) {
for (int j = 1; j < m; j++) {
g[i][j] = a[i][j] + a[i + 1][j + 1] == a[i + 1][j] + a[i][j + 1];
}
}
for (int i = 1; i < n; i++) {
for (int j = 1; j < m; j++) {
s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + g[i][j];
}
}
while (t--) {
int x, y, k;
cin >> x >> y >> k;
cout << (k == 1 || sum(x, y, x + k - 2, y + k - 2) == (k - 1) * (k - 1) ? 'Y' : 'N') << endl;
}
return 0;
}

BIN
LibreOJ/6256/data/1.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/10.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/10.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/2.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/3.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/4.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/5.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/6.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/7.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/7.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/8.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/8.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/9.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
LibreOJ/6256/data/9.in (Stored with Git LFS) Normal file

Binary file not shown.