Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>

#define MOD 1000000007
#define INF INT_MAX
#define NINF INT_MIN
#define LLINF LLONG_MAX
using ll = long long;
using namespace std;

int time[200020];

int main() {
    int N, C, m;
    cin >> N >> C;
    for (int i = 0; i < N; i++)
    {
        int s, t, c;
        cin >> s >> t >> c;
        time[2 * s - 1]++;
        time[2 * t + 1]--;
    }
    m = time[0];
    for (int i = 0; i < 200020; i++)
    {
        time[i + 1] += time[i];
        m = max(time[i], m);
    }
    cout << m << endl;
    getchar(); getchar();
    return 0;
}

Compiler output:
a.cc:15:16: error: 'int time [200020]' redeclared as different kind of entity
   15 | int time[200020];
      |                ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 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/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:24:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |         time[2 * s - 1]++;
      |                       ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:24:23: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   24 |         time[2 * s - 1]++;
      |         ~~~~~~~~~~~~~~^
a.cc:24:23: error: lvalue required as increment operand
   24 |         time[2 * s - 1]++;
      |                       ^
a.cc:25:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   25 |         time[2 * t + 1]--;
      |                       ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:25:23: warning: ISO C++ forbids decrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   25 |         time[2 * t + 1]--;
      |         ~~~~~~~~~~~~~~^
a.cc:25:23: error: lvalue required as decrement operand
   25 |         time[2 * t + 1]--;
      |                       ^
a.cc:27:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   27 |     m = time[0];
      |               ^
a.cc:27:15: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   27 |     m = time[0];
      |         ~~~~~~^
      |               |
      |               time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:30:19: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |         time[i + 1] += time[i];
      |                   ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:30:30: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |         time[i + 1] += time[i];
      |                              ^
a.cc:30:21: error: invalid operands of types 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to binary 'operator+'
   30 |         time[i + 1] += time[i];
      |         ~~~~~~~~~~~~^~~~~~~~~~
a.cc:30:21: note:   in evaluation of 'operator+=(time_t(time_t*) noexcept {aka long int(long int*) noexcept}, time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept})'
a.cc:31:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   31 |         m = max(time[i], m);
      |                       ^
a.cc:31:16: error: no matching function for call to 'max(time_t (&)(time_t*) noexcept, int&)'
   31 |         m = max(time[i], m);
      |             ~~~^~~~~~~~~~~~
In file included 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:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:31:16: note:   deduced conflicting types for parameter 'const _Tp' ('long int(long int*) noexcept' and 'int')
   31 |         m = max(time[i], m);
      |             ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:31:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'}
   31 |         m = max(time[i], m);
      |             ~~~^~~~~~~~~~~~