Submission #572244

#TimeUsernameProblemLanguageResultExecution timeMemory
572244SSRSHyper-minimum (IZhO11_hyper)C++14
100 / 100
752 ms36680 KiB
#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 timeMemoryGrader output
Fetching results...