Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

int n, k;
vector<int> xs, ys, zs;
map<int, int> zipx, zipy, zipz;//<???, ??§??????>
map<int, int> unzipx, unzipy, unzipz;//<??§??????, ???>
int num[100][100][100];//???????¨?????????\??????

int main(void){
	cin >> n >> k;
	int x1[51], x2[51], y1[51], y2[51], z1[51], z2[51];//?????????????????§?¨?
	rep(i, n){
		cin >> x1[i] >> y1[i] >> z1[i];
		cin >> x2[i] >> y2[i] >> z2[i];
		xs.push_back(x1[i]); xs.push_back(x2[i]);
		ys.push_back(y1[i]); ys.push_back(y2[i]);
		zs.push_back(z1[i]); zs.push_back(z2[i]);
	}
	sort(xs.begin(), xs.end());
	xs.erase(unique(xs.begin(), xs.end(), xs.end()));//???????¶????
	sort(ys.begin(), ys.end());
	ys.erase(unique(ys.begin(), ys.end(), ys.end()));
	sort(zs.begin(), zs.end());
	zs.erase(unique(zs.begin(), zs.end(), zs.end()));

	rep(i, xs.size()){
		zipx[i] = xs[i];
		unzipx[xs[i]] = i;
	}
	rep(i, ys.size()){
		zipy[i] = ys[i];
		unzipy[ys[i]] = i;
	}
	rep(i, zs.size()){
		zipz[i] = zs[i];
		unzipz[zs[i]] = i;
	}

	memset(num, 0, sizeof(num));
	for (int i = 0; i < n; ++i){
		for (int x = unzipx[x1[i]]; x < unzipx[x2[i]]; ++x){
			for (int y = unzipy[y1[i]]; y < unzipy[x2[i]]; ++y){
				for (int z = unzipz[z1[i]]; z < unzipz[z2[i]]; ++z){
					num[x][y][z]++;
				}
			}
		}
	}
	int ans = 0;
	rep(x, 100)rep(y, 100)rep(z, 100){
		if(num[x][y][z] >= k) ans++;
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Iterator2 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = __gnu_cxx::__normal_iterator<int*, std::vector<int> >]':
/usr/include/c++/14/bits/stl_algo.h:869:20:   required from '_ForwardIterator std::__unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, vector<int> >; _BinaryPredicate = __gnu_cxx::__ops::_Iter_comp_iter<__gnu_cxx::__normal_iterator<int*, vector<int> > >]'
  869 |         if (!__binary_pred(__dest, __first))
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:933:27:   required from '_FIter std::unique(_FIter, _FIter, _BinaryPredicate) [with _FIter = __gnu_cxx::__normal_iterator<int*, vector<int> >; _BinaryPredicate = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
  933 |       return std::__unique(__first, __last,
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  934 |                            __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:35:17:   required from here
   35 |         xs.erase(unique(xs.begin(), xs.end(), xs.end()));//???????¶????
      |                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(__gnu_cxx::__normal_iterator<int*, std::vector<int> >) (int&, int&)'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~