# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
480996 | FatihSolak | Hyper-minimum (IZhO11_hyper) | C++17 | 5 ms | 332 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;
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))));
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 + d < n){
v2[i][j][k][c] = min(v2[i][j][k][c],v[i][j][k][c+d]);
}
if(x == 2 && k + d < n){
v2[i][j][k][c] = min(v2[i][j][k][c],v[i][j][k+d][c]);
}
if(x == 3 && j + d < n){
v2[i][j][k][c] = min(v2[i][j][k][c],v[i][j+d][k][c]);
}
if(x == 4 && i + d < n){
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++){
cout << v[i][j][k][c] << " ";
}
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |