# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
339876 | beksultan04 | Hyper-minimum (IZhO11_hyper) | C++14 | 478 ms | 91500 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 long long
#define pii pair<int,int>
#define OK puts("OK");
#define NO puts("NO");
#define YES puts("YES");
#define fr first
#define sc second
#define ret return
#define scan1(a) scanf("%lld",&a);
#define scan2(a,b) scanf("%lld %lld",&a, &b);
#define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c);
#define all(s) s.begin(),s.end()
#define allr(s) s.rbegin(),s.rend()
#define pb push_back
#define sz(v) (int)v.size()
#define endi puts("");
const int N = 1e5+12,INF=1e9+7;
int a[36][36][36][36],b[6][36][36][36][36];
main(){
int n,i,j,k,l,x,m;
scan2(n,m)
for (i=1;i<=n;++i){
for (j=1;j<=n;++j){
for (k=1;k<=n;++k){
for(l=1;l<=n;++l){
scan1(a[i][j][k][l])
b[0][i][j][k][l]=b[1][i][j][k][l]=b[2][i][j][k][l]=b[3][i][j][k][l]=INF;
}
}
}
}
for (x=0;x<m;++x)
for (i=1;i<=n;++i)
for (j=1;j<=n;++j)
for (k=1;k<=n;++k)
for (l=1;l<=n;++l){
if (l+x <= n)
b[0][i][j][k][l] = min(b[0][i][j][k][l],a[i][j][k][l+x]);
}
for (x=0;x<m;++x)
for (i=1;i<=n;++i)
for (j=1;j<=n;++j)
for (k=1;k<=n;++k)
if (k+x <= n)
for (l=1;l<=n;++l){
b[1][i][j][k][l] = min(b[1][i][j][k][l],b[0][i][j][k+x][l]);
}
for (x=0;x<m;++x)
for (i=1;i<=n;++i)
for (j=1;j<=n;++j)
if (j+x <= n)
for (k=1;k<=n;++k)
for (l=1;l<=n;++l){
b[2][i][j][k][l] = min(b[2][i][j][k][l],b[1][i][j+x][k][l]);
}
for (x=0;x<m;++x)
for (i=1;i<=n;++i)
if (i+x <= n)
for (j=1;j<=n;++j)
for (k=1;k<=n;++k)
for (l=1;l<=n;++l){
b[3][i][j][k][l] = min(b[3][i][j][k][l],b[2][i+x][j][k][l]);
}
for (i=1;i<=n-m+1;++i){
for (j=1;j<=n-m+1;++j){
for (k=1;k<=n-m+1;++k){
for(l=1;l<=n-m+1;++l){
cout <<b[3][i][j][k][l]<<" ";
}
}
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |