# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1087897 | LilPluton | Hyper-minimum (IZhO11_hyper) | C++14 | 504 ms | 40532 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;
#define int ll
#define ll long long
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const int sz = 1e5 + 5;
signed main(){
int n, m;
cin >> n >> m;
int a[n][n][n][n];
for(int i = 0; i < n; ++i){
for(int j = 0; j < n; ++j){
for(int k = 0; k < n; ++k){
for(int l = 0; l < n; ++l){
cin >> a[i][j][k][l];
}
}
}
}
for(int i = 0; i < n; ++i){
for(int j = 0; j < n; ++j){
for(int k = 0; k < n; ++k){
for(int l = 0; l <= n - m; ++l){
for(int o = 0; o < m; ++o){
a[i][j][k][l] = min(a[i][j][k][l], a[i][j][k][l + o]);
}
}
}
}
}
for(int i = 0; i < n; ++i){
for(int j = 0; j < n; ++j){
for(int k = 0; k <= n - m; ++k){
for(int l = 0; l < n; ++l){
for(int o = 0; o < m; ++o){
a[i][j][k][l] = min(a[i][j][k][l], a[i][j][k + o][l]);
}
}
}
}
}
for(int i = 0; i < n; ++i){
for(int j = 0; j <= n - m; ++j){
for(int k = 0; k < n; ++k){
for(int l = 0; l < n; ++l){
for(int o = 0; o < m; ++o){
a[i][j][k][l] = min(a[i][j][k][l], a[i][j + o][k][l]);
}
}
}
}
}
for(int i = 0; i <= n - m; ++i){
for(int j = 0; j < n; ++j){
for(int k = 0; k < n; ++k){
for(int l = 0; l < n; ++l){
for(int o = 0; o < m; ++o){
a[i][j][k][l] = min(a[i][j][k][l], a[i + o][j][k][l]);
}
}
}
}
}
for (int i = 0; i <= n - m; ++i){
for (int j = 0; j <= n - m; ++j){
for (int k = 0; k <= n - m; ++k){
for (int l = 0; l <= n - m; l ++){
cout << a[i][j][k][l] << ' ';
}
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |