# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1108821 | Tsagana | 최솟값 배열 (IZhO11_hyper) | C++14 | 282 ms | 32244 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define all(x) x.begin(), x.end()
#define lnl long long
#define pq priority_queue
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pp pop_back
#define F first
#define S second
using namespace std;
int antiloop = 0;
int n, m;
int X[37][37][37][37];
int Y[37][37][37][37];
void calc(int t) {
for (int i = 1; i <= n-m+1 + (t == 4 ? 0 : m-1); i++) {
for (int j = 1; j <= n-m+1 + (t == 3 ? 0 : m-1); j++) {
for (int l = 1; l <= n-m+1 + (t == 2 ? 0 : m-1); l++) {
for (int k = 1; k <= n-m+1 + (t == 1 ? 0 : m-1); k++) {
for (int p = 0; p < m; p++) {
if (t == 1) Y[i][j][l][k] = min(Y[i][j][l][k], Y[i][j][l][k+p]);
if (t == 2) Y[i][j][l][k] = min(Y[i][j][l][k], Y[i][j][l+p][k]);
if (t == 3) Y[i][j][l][k] = min(Y[i][j][l][k], Y[i][j+p][l][k]);
if (t == 4) Y[i][j][l][k] = min(Y[i][j][l][k], Y[i+p][j][l][k]);
}
}
}
}
}
}
void solve () {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
for (int l = 1; l <= n; l++) {
for (int k = 1; k <= n; k++) {
cin >> X[i][j][l][k];
Y[i][j][l][k] = X[i][j][l][k];
}
}
}
}
for (int i = 1; i <= 4; i++) calc(i);
//cout << "HERE!"; return ;
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++) {
cout << Y[i][j][l][k] << ' ';
}
}
}
}
}
int main() {IOS solve(); return 0;}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |