Submission #1072824

#TimeUsernameProblemLanguageResultExecution timeMemory
1072824coolboy19521Hyper-minimum (IZhO11_hyper)C++17
100 / 100
455 ms37452 KiB
#include "bits/stdc++.h" #define ll long long using namespace std; const int sz = 40; int a[sz][sz][sz][sz]; int main() { int n, m; cin >> n >> m; 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 - 1; 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 - 1; 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 - 1; 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 - 1; 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] << ' '; cout << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...