# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
412300 | ritul_kr_singh | Hyper-minimum (IZhO11_hyper) | C++17 | 445 ms | 27824 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.
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sp << ' ' <<
#define nl << '\n'
signed main(){
cin.tie(0)->sync_with_stdio(0);
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; ++l)
for(int x=i; x<min(n, i+m); ++x)
a[i][j][k][l] = min(a[i][j][k][l], a[x][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; ++l)
for(int x=j; x<min(n, j+m); ++x)
a[i][j][k][l] = min(a[i][j][k][l], a[i][x][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; ++l)
for(int x=k; x<min(n, k+m); ++x)
a[i][j][k][l] = min(a[i][j][k][l], a[i][j][x][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; ++l)
for(int x=l; x<min(n, l+m); ++x)
a[i][j][k][l] = min(a[i][j][k][l], a[i][j][k][x]);
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... |