MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / main

Function main

codes/cpp/Code_5_05_2.cpp:17–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17int main() {
18 // ����
19 cin >> N >> K;
20 for (int i = 1; i <= N; i++) cin >> X[i] >> Y[i];
21
22 // ���[ x�A�E�[ x�A���[ y�A��[ y ��S�T���i���ꂼ��̔ԍ��� i, j, k, l�j
23 for (int i = 1; i <= N; i++) {
24 for (int j = 1; j <= N; j++) {
25 for (int k = 1; k <= N; k++) {
26 for (int l = 1; l <= N; l++) {
27 int cl = X[i]; // ���[�� x ���W
28 int cr = X[j]; // �E�[�� x ���W
29 int dl = Y[k]; // ���[�� y ���W
30 int dr = Y[l]; // ��[�� y ���W
31 if (check_numpoints(cl, cr, dl, dr) >= K) {
32 long long area = 1LL * (cr - cl) * (dr - dl);
33 Answer = min(Answer, area);
34 }
35 }
36 }
37 }
38 }
39
40 // �����̏o��
41 cout << Answer << endl;
42 return 0;
43}

Callers

nothing calls this directly

Calls 2

minFunction · 0.85
check_numpointsFunction · 0.70

Tested by

no test coverage detected