Submission #480997

#TimeUsernameProblemLanguageResultExecution timeMemory
480997FatihSolakHyper-minimum (IZhO11_hyper)C++17
100 / 100
717 ms36784 KiB
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n,m; cin >> n >> m; vector<vector<vector<vector<int>>>> v(n,vector<vector<vector<int>>>(n,vector<vector<int>>(n,vector<int>(n)))); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ for(int k = 0;k<n;k++){ for(int c = 0;c<n;c++){ cin >> v[i][j][k][c]; } } } } for(int x=1;x<=4;x++){ vector<vector<vector<vector<int>>>> v2(n,vector<vector<vector<int>>>(n,vector<vector<int>>(n,vector<int>(n,1e9 + 5)))); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ for(int k = 0;k<n;k++){ for(int c = 0;c<n;c++){ for(int d = 0;d<m;d++){ if(x == 1 && c < n - m + 1){ v2[i][j][k][c] = min(v2[i][j][k][c],v[i][j][k][c+d]); } if(x == 2 && k < n - m + 1){ v2[i][j][k][c] = min(v2[i][j][k][c],v[i][j][k+d][c]); } if(x == 3 && j < n - m + 1){ v2[i][j][k][c] = min(v2[i][j][k][c],v[i][j+d][k][c]); } if(x == 4 && i < n - m + 1){ v2[i][j][k][c] = min(v2[i][j][k][c],v[i+d][j][k][c]); } } } } } } v = v2; } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ for(int k = 0;k<n;k++){ for(int c = 0;c<n;c++){ if(v[i][j][k][c] != 1e9+5) cout << v[i][j][k][c] << " "; } } } } }
#Verdict Execution timeMemoryGrader output
Fetching results...