我要崩溃,当时还以为是需要什么离散化的,原来是暴力,特么五层循环。。。。我自己写怎么都错。。。。。暴力都不会了,,,,,
1 #include2 #include 3 #include 4 #include 5 using namespace std; 6 typedef long long ll; 7 const int maxn = 105; 8 int N, K; 9 10 int main()11 {12 cin >> N >> K;13 ll x[maxn], y[maxn], a[maxn], b[maxn];14 for (int i = 0; i > a[i] >> b[i];16 x[i] = a[i], y[i] = b[i];17 }18 sort(x, x + N);19 sort(y, y + N);20 ll ans = 1ll << 62;21 for (int i = 0; i < N; i++) {22 for(int j=i+1;j = sx&&a[m] <= gx&&b[m] >= sy&&b[m] <= gy)32 cnt++;33 }34 if (cnt >= K)35 ans = min(ans, (gx - sx)*(gy - sy));36 }37 }38 }39 cout << ans << endl;40 return 0;41 }