# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
588100 | jmyszka2007 | Coins (LMIO19_monetos) | C++17 | 16 ms | 996 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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';
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |