답안 #17697

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
17697 2016-01-12T08:53:23 Z Adilkhan 최솟값 배열 (IZhO11_hyper) C++
25 / 100
2000 ms 25160 KB
#include <bits/stdc++.h>

#define pb push_back
#define endl "\n"
#define mp make_pair 
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define fname ""
#define sz(x) (int)(x.size())

typedef long long ll;

using namespace std;

const ll N = (ll)(5e5) + 322;
const ll INF = (ll)(1e18);
const ll mod = (ll)(1e9) + 7;
const double eps = 1e-9;

ll n, m, sz, a[35][35][35][35], sm, d[35][35][35][35];

ll getmn(int I, int J, int K, int Q) {
	ll res = INF;
	for (int i = I; i <= I + m - 1; ++i) {
		for (int j = J; j <= J + m - 1; ++j) {
			for (int k = K; k <= K + m - 1; ++k) {
				for (int q = Q; q <= Q + m - 1; ++q) {
					res = min(a[i][j][k][q], res);					
				}
			}		
		}
	}
	return res;
}

int main () {
	ios_base :: sync_with_stdio (false); cin.tie(0);
	//freopen(fname".in", "r", stdin);
	//freopen(fname".out", "w", stdout);
	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 q = 1; q <= n; ++q) {
			  	cin >> a[i][j][k][q];
			  }
			}
		}
	}
	sm = n - m + 1;
	for (int i = 1; i <= sm; ++i) {
		for (int j = 1; j <= sm; ++j) {
		  for (int k = 1; k <= sm; ++k) {
		  	for (int q = 1; q <= sm; ++q) {
					d[i][j][k][q] = getmn(i, j, k, q);		  			
		  	}
		  }	
		}					
	}
	for (int i = 1; i <= sm; ++i) {
		for (int j = 1; j <= sm; ++j) {
		  for (int k = 1; k <= sm; ++k) {
		  	for (int q = 1; q <= sm; ++q) {
					cout << d[i][j][k][q] << ' ';		  			
		  	}
		  }	
		}					
	}
	
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 25160 KB Output is correct
2 Correct 0 ms 25160 KB Output is correct
3 Correct 0 ms 25160 KB Output is correct
4 Runtime error 0 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
5 Runtime error 4 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
6 Runtime error 26 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
7 Runtime error 34 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
8 Correct 42 ms 25160 KB Output is correct
9 Runtime error 24 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
10 Runtime error 238 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
11 Runtime error 1267 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
12 Execution timed out 2000 ms 25160 KB Program timed out
13 Correct 160 ms 25160 KB Output is correct
14 Runtime error 343 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
15 Runtime error 225 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
16 Runtime error 1345 ms 25160 KB writev (syscall #20) was called by the program (disallowed syscall)
17 Execution timed out 2000 ms 25160 KB Program timed out
18 Incorrect 203 ms 25160 KB Output isn't correct
19 Incorrect 212 ms 25160 KB Output isn't correct
20 Runtime error 211 ms 25160 KB Program hung waiting for input