#include <bits/stdc++.h>
using namespace std;
const int N = 105;
char mx[N][N];
static int ask(int l1, int c1, int l2, int c2) {
int x;
cout << l1 << ' ' << c1 << ' ' << l2 << ' ' << c2 << endl;
cin >> x;
return x; }
static void divide(int l1, int c1, int l2, int c2, int count) {
if (count == (l2 - l1 + 1) * (c2 - c1 + 1)) {
for (int i = l1; i <= l2; ++i)
for (int j = c1; j <= c2; ++j)
mx[i][j] = '1';
return; }
if (count == 0)
return;
if (l2 - l1 >= c2 - c1) {
int mid = (l1 + l2) / 2;
int half = ask(l1, c1, mid, c2);
divide(l1, c1, mid, c2, half);
divide(mid + 1, c1, l2, c2, count - half); }
else {
int mid = (c1 + c2) / 2;
int half = ask(l1, c1, l2, mid);
divide(l1, c1, l2, mid, half);
divide(l1, mid + 1, l2, c2, count - half); } }
int n;
int main() {
cin >> n;
for (int i = 1; i <= n; ++i)
for (int j = 1; j <= n; ++j)
mx[i][j] = '0';
divide(1, 1, n, n, ask(1, 1, n, n));
cout << "END" << endl;
for (int i = 1; i <= n; ++i)
cout << (mx[i] + 1) << endl;
return 0; }
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
512 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
444 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
1024 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |