# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
572244 | SSRS | Hyper-minimum (IZhO11_hyper) | C++14 | 752 ms | 36680 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;
int main(){
int N, M;
cin >> N >> M;
vector<vector<vector<vector<int>>>> X(N, vector<vector<vector<int>>>(N, vector<vector<int>>(N, vector<int>(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 >> X[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 m = 0; m < M; m++){
X[i][j][k][l] = min(X[i][j][k][l], X[i][j][k][l + m]);
}
}
}
}
}
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 < M; l++){
for (int m = 0; m <= N - M; m++){
X[i][j][k][m] = min(X[i][j][k][m], X[i][j][k + l][m]);
}
}
}
}
}
for (int i = 0; i < N; i++){
for (int j = 0; j <= N - M; j++){
for (int k = 0; k < M; k++){
for (int l = 0; l <= N - M; l++){
for (int m = 0; m <= N - M; m++){
X[i][j][l][m] = min(X[i][j][l][m], X[i][j + k][l][m]);
}
}
}
}
}
for (int i = 0; i <= N - M; i++){
for (int j = 0; j < M; j++){
for (int k = 0; k <= N - M; k++){
for (int l = 0; l <= N - M; l++){
for (int m = 0; m <= N - M; m++){
X[i][k][l][m] = min(X[i][k][l][m], X[i + j][k][l][m]);
}
}
}
}
}
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 << X[i][j][k][l];
if (i < N - M || j < N - M || k < N - M || l < N - M){
cout << ' ';
}
}
}
}
}
cout << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |