# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
880019 | alexdd | Hyper-minimum (IZhO11_hyper) | C++17 | 1116 ms | 262144 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>
#pragma GCC optimize("O3,unroll-loops")
using namespace std;
int x[35][35][35][35];
int mnm[35][35][35][35][35];
int n,m;
signed main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>n>>m;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
for(int k=1;k<=n;k++)
{
for(int l=1;l<=n;l++)
{
cin>>x[i][j][k][l];
mnm[i][j][k][l][1] = x[i][j][k][l];
}
}
}
}
for(int p=2;p<=m;p++)
{
for(int i=n-p+1;i>0;i--)
{
for(int j=n-p+1;j>0;j--)
{
for(int k=n-p+1;k>0;k--)
{
for(int l=n-p+1;l>0;l--)
{
mnm[i][j][k][l][p] = mnm[i][j][k][l][p-1];
for(int mask=1;mask<(1<<4);mask++)
{
mnm[i][j][k][l][p] = min(mnm[i][j][k][l][p], mnm[i+(((1<<0)&mask)!=0)][j+(((1<<1)&mask)!=0)][k+(((1<<2)&mask)!=0)][l+(((1<<3)&mask)!=0)][p-1]);
}
}
}
}
}
}
for(int i=1;i<=n-m+1;i++)
{
for(int j=1;j<=n-m+1;j++)
{
for(int k=1;k<=n-m+1;k++)
{
for(int l=1;l<=n-m+1;l++)
{
cout<<mnm[i][j][k][l][m]<<" ";
}
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |