Submission #764528

#TimeUsernameProblemLanguageResultExecution timeMemory
764528TrunktyHyper-minimum (IZhO11_hyper)C++14
100 / 100
497 ms123212 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll int n,m; int arr[45][45][45][45],mini1[45][45][45][45],mini2[45][45][45][45],mini3[45][45][45][45],mini4[45][45][45][45]; signed main(){ ios::sync_with_stdio(false); cin.tie(NULL); 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 >> arr[i][j][k][l]; } } } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ for(int k=1;k<=n;k++){ multiset<int> s; for(int l=n;l>=1;l--){ if(l<=n-m){ s.erase(s.find(arr[i][j][k][l+m])); } s.insert(arr[i][j][k][l]); if(l<=n-m+1LL){ mini1[i][j][k][l] = *s.begin(); } } } } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ for(int k=1;k<=n;k++){ multiset<int> s; for(int l=n;l>=1;l--){ if(l<=n-m){ s.erase(s.find(mini1[i][j][l+m][k])); } s.insert(mini1[i][j][l][k]); if(l<=n-m+1LL){ mini2[i][j][l][k] = *s.begin(); } } } } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ for(int k=1;k<=n;k++){ multiset<int> s; for(int l=n;l>=1;l--){ if(l<=n-m){ s.erase(s.find(mini2[i][l+m][j][k])); } s.insert(mini2[i][l][j][k]); if(l<=n-m+1LL){ mini3[i][l][j][k] = *s.begin(); } } } } } for(int i=1;i<=n;i++){ for(int j=1;j<=n;j++){ for(int k=1;k<=n;k++){ multiset<int> s; for(int l=n;l>=1;l--){ if(l<=n-m){ s.erase(s.find(mini3[l+m][i][j][k])); } s.insert(mini3[l][i][j][k]); if(l<=n-m+1LL){ mini4[l][i][j][k] = *s.begin(); } } } } } for(int i=1;i<=n-m+1LL;i++){ for(int j=1;j<=n-m+1LL;j++){ for(int k=1;k<=n-m+1LL;k++){ for(int l=1;l<=n-m+1LL;l++){ cout << mini4[i][j][k][l] << " "; } } } } cout << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...