답안 #17689

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

using namespace std;

#define ll long long
#define foreach(it, S) for (__typeof (S.begin()) it = S.begin(); it != S.end(); it++)
#define all(x) x.begin(), x.end()
#define endl '\n'
#define _ ios_base :: sync_with_stdio(false); cin.tie(NULL);

#ifdef inputf
	#define fname ""
#else
	#define fname "" // <- Here
#endif

const double eps = 1e-9;
const int MaxN = int(2e5) + 256;
const int MOD = int(1e9) + 7;

template <typename T> inline T gcd(T a, T b) {
	return b ? gcd (b, a % b) : a;
}

inline bool Palindrome(const string& s) {
	return equal(s.begin(), s.end(), s.rbegin());
}

int x[90][90][90][90];

int main() { // _
	#ifdef lcl
		freopen(fname".in", "r", stdin);
		freopen(fname".out", "w", stdout);
	#endif

	int n, m; scanf("%d%d", &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)
					scanf("%d", &x[i][j][k][l]);

	
	for (int i1 = 1; i1 <= n - m + 1; ++i1)
		for (int i2 = 1; i2 <= n - m + 1; ++i2)
			for (int i3 = 1; i3 <= n - m + 1; ++i3)
				for (int i4 = 1; i4 <= n - m + 1; ++i4) {
					int val = INT_MAX;
					for (int j1 = i1; j1 <= i1 + m - 1; ++j1)
						for (int j2 = i2; j2 <= i2 + m - 1; ++j2)
							for (int j3 = i3; j3 <= i3 + m - 1; ++j3)
								for (int j4 = i4; j4 <= i4 + m - 1; ++j4) {
									val = min(val, x[j1][j2][j3][j4]);
								}
					printf("%d ", val);
				}
	
	
	return 0;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 258008 KB Output is correct
2 Correct 2 ms 258008 KB Output is correct
3 Correct 0 ms 258008 KB Output is correct
4 Correct 3 ms 258008 KB Output is correct
5 Correct 0 ms 258008 KB Output is correct
6 Correct 43 ms 258008 KB Output is correct
7 Correct 37 ms 258008 KB Output is correct
8 Correct 42 ms 258008 KB Output is correct
9 Correct 29 ms 258008 KB Output is correct
10 Correct 251 ms 258008 KB Output is correct
11 Correct 1330 ms 258008 KB Output is correct
12 Execution timed out 2000 ms 258008 KB Program timed out
13 Correct 166 ms 258008 KB Output is correct
14 Correct 587 ms 258008 KB Output is correct
15 Correct 406 ms 258008 KB Output is correct
16 Correct 1638 ms 258008 KB Output is correct
17 Execution timed out 2000 ms 258008 KB Program timed out
18 Correct 599 ms 258008 KB Output is correct
19 Execution timed out 2000 ms 258008 KB Program timed out
20 Correct 449 ms 258008 KB Output is correct