#include <bits/stdc++.h>
using namespace std;
int tab[310][310];
int res[310][310];
int main() {
int t, n, a, b;
cin >> t >> n >> a >> b;
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
cin >> tab[i][j];
}
}
int ans = 0;
for(int i = 1; i <= n / 2; i++) {
for(int j = 1; j <= n; j++) {
if(tab[i][j]) {
ans++;
}
}
}
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
if(i <= n / 2) {
res[i][j] = 0;
}
else {
res[i][j] = 1;
}
}
}
int tmp = ans;
int mn = ans;
int y = n / 2;
int x = n;
for(int i = n / 2 + 1; i <= n; i++) {
for(int j = 1; j <= n / 2; j++) {
if(!tab[i][j] && tab[y][x]) {
ans--;
mn = min(mn, ans);
}
if(tab[i][j] && !tab[y][x]) {
ans++;
}
if(x == n / 2) {
x = n;
y--;
}
else {
x--;
}
}
}
y = n / 2;
x = n;
if(mn <= a) {
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
cout << "0 ";
}
cout << '\n';
}
}
}
Compilation message
monetos.cpp: In function 'int main()':
monetos.cpp:31:6: warning: unused variable 'tmp' [-Wunused-variable]
31 | int tmp = ans;
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Unexpected end of file - int32 expected |
2 |
Incorrect |
1 ms |
340 KB |
Unexpected end of file - int32 expected |
3 |
Incorrect |
12 ms |
920 KB |
Unexpected end of file - int32 expected |
4 |
Incorrect |
12 ms |
956 KB |
Unexpected end of file - int32 expected |
5 |
Incorrect |
16 ms |
984 KB |
Unexpected end of file - int32 expected |
6 |
Incorrect |
12 ms |
996 KB |
Unexpected end of file - int32 expected |
7 |
Incorrect |
13 ms |
952 KB |
Unexpected end of file - int32 expected |
8 |
Incorrect |
12 ms |
980 KB |
Unexpected end of file - int32 expected |
9 |
Incorrect |
12 ms |
980 KB |
Unexpected end of file - int32 expected |
10 |
Incorrect |
15 ms |
912 KB |
Unexpected end of file - int32 expected |