Submission #337604

#TimeUsernameProblemLanguageResultExecution timeMemory
337604amunduzbaevHyper-minimum (IZhO11_hyper)C++14
0 / 100
2085 ms15084 KiB
/** made by amunduzbaev **/ #include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back #define mp make_pair #define ub upper_bound #define lb lower_bound #define ll long long #define ld long double #define pii pair<int, int> #define pll pair<ll, ll> #define sz(x) (int)x.size() #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(),x.rend() #define fastios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define vll vector<ll> #define vii vector<int> const int N = 40; const int mod = 1e9+7; const ll inf = 1e18; const ld Pi = acos(-1); ll n, m, k, t; //, ans; ll a[N][N][N][N], ans[N][N][N][N]; void solve(){ fastios 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>>a[i][j][k][l]; for(int i = 1; i <= n-m+1; i++){ for(int j = 1; j <= n-m+1; j++){ for(int l = 1; l <= n-m+1; l++){ for(int k = 1; k <= n-m+1; k++){ ll tmp = inf; for(int i1 = i; i1 <= i+m-1; i1++){ for(int j1 = j; j1 <= j+m-1; j1++){ for(int k1 = k; k1 <= k+m-1; k1++) for(int l1 = l; l1 <= l+m-1; l1++) tmp = min(a[i1][j1][k1][l1], tmp); } } ans[i][j][k][l] = tmp; } } } } 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<<ans[i][j][k][l]<<" "; } } return; } /* 4 4 5 3 1000000 0 1 0 3 2 1 2 3 4 3 */ int main(){ fastios int t = 1; if(t) solve(); else { cin>>t; while (t--) solve(); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...