# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1109767 | Kirill22 | Hyper-minimum (IZhO11_hyper) | C++17 | 2068 ms | 14408 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
using namespace std;
const int N = 35;
int n, m;
int a[N][N][N][N];
void solve() {
cin >> n >> m;
assert(n <= N);
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
for (int x = 0; x < n; x++) {
for (int y = 0; y < n; y++) {
cin >> a[i][j][x][y];
}
}
}
}
for (int i = 0; i + m <= n; i++) {
for (int j = 0; j + m <= n; j++) {
for (int x = 0; x + m <= n; x++) {
for (int y = 0; y + m <= n; y++) {
int ans = a[i][j][x][y];
for (int i2 = 0; i2 < m; i2++) for (int j2 = 0; j2 < m; j2++) {
for (int x2 = 0; x2 < m; x2++) for (int y2 = 0; y2 < m; y2++) {
ans = min(ans, a[i + i2][j + j2][x + x2][y + y2]);
}
}
cout << ans << " ";
}
}
}
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1;
// cin >> t;
while (t--) {
solve();
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |