Language: C++

/**
 *    author:  FromDihPout
 *    created: 2020-08-10
**/

#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(), (x).end()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, c;
    cin >> n >> c;
    vector<pair<pair<int,int>, int>> a(n);
    for (int i = 0; i < n; i++) {
        int s, t, c;
        cin >> s >> t >> c;
        a[i] = {{s, t}, c};
    }
    sort(all(a));
    
    vector<pair<int,int>> r(c, {-1, -1});
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < c; j++) {
            if (a[i].s == r[j].s && a[i].f.f >= r[j].f) {
                r[j].f = a[i].f.s;
                break;
            }
            else if (a[i].f.f - 0.5 >= r[j].f) {
                r[j].f = a[i].f.s;
                r[j].s = a[i].s;
                break;
            }
        }
    }
    
    int ans = 0;
    for (int i = 0; i < c; i++) {
        if (r[i].f != -1) {
            ans++;
        }
    }
    cout << ans << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:22: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::pair<int, int>, int> >, std::pair<std::pair<int, int>, int> >::value_type' {aka 'struct std::pair<std::pair<int, int>, int>'} has no member named 's'
   28 |             if (a[i].s == r[j].s && a[i].f.f >= r[j].f) {
      |                      ^
a.cc:28:32: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 's'
   28 |             if (a[i].s == r[j].s && a[i].f.f >= r[j].f) {
      |                                ^
a.cc:28:42: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::pair<int, int>, int> >, std::pair<std::pair<int, int>, int> >::value_type' {aka 'struct std::pair<std::pair<int, int>, int>'} has no member named 'f'
   28 |             if (a[i].s == r[j].s && a[i].f.f >= r[j].f) {
      |                                          ^
a.cc:28:54: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'f'
   28 |             if (a[i].s == r[j].s && a[i].f.f >= r[j].f) {
      |                                                      ^
a.cc:29:22: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'f'
   29 |                 r[j].f = a[i].f.s;
      |                      ^
a.cc:29:31: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::pair<int, int>, int> >, std::pair<std::pair<int, int>, int> >::value_type' {aka 'struct std::pair<std::pair<int, int>, int>'} has no member named 'f'
   29 |                 r[j].f = a[i].f.s;
      |                               ^
a.cc:32:27: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::pair<int, int>, int> >, std::pair<std::pair<int, int>, int> >::value_type' {aka 'struct std::pair<std::pair<int, int>, int>'} has no member named 'f'
   32 |             else if (a[i].f.f - 0.5 >= r[j].f) {
      |                           ^
a.cc:32:45: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'f'
   32 |             else if (a[i].f.f - 0.5 >= r[j].f) {
      |                                             ^
a.cc:33:22: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'f'
   33 |                 r[j].f = a[i].f.s;
      |                      ^
a.cc:33:31: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::pair<int, int>, int> >, std::pair<std::pair<int, int>, int> >::value_type' {aka 'struct std::pair<std::pair<int, int>, int>'} has no member named 'f'
   33 |                 r[j].f = a[i].f.s;
      |                               ^
a.cc:34:22: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 's'
   34 |                 r[j].s = a[i].s;
      |                      ^
a.cc:34:31: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<std::pair<int, int>, int> >, std::pair<std::pair<int, int>, int> >::value_type' {aka 'struct std::pair<std::pair<int, int>, int>'} has no member named 's'
   34 |                 r[j].s = a[i].s;
      |                               ^
a.cc:42:18: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'f'
   42 |         if (r[i].f != -1) {
      |                  ^