Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <cstring>
#include <queue>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rev(i,n) for(int i=(int)n-1;i>=0;i--)
#define all(a) a.begin(),a.end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define SS stringstream
#define DBG1(a) rep(_X,sz(a)){printf("%d ",a[_X]);}puts("");
#define DBG2(a) rep(_X,sz(a)){rep(_Y,sz(a[_X]))printf("%d ",a[_X][_Y]);puts("");}
#define bitcount(b) __builtin_popcount(b)
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)

#define delete(a,n) a.erase(remove(all(a),n),a.end())
template<typename T, typename S> vector<T>& operator<<(vector<T>& a, S b) { a.push_back(b); return a; }
template<typename T> void operator>>(vector<T>& a, int b) {while(b--)if(!a.empty())a.pop_back();}
bool isprime(int n){ if(n<2)return false;  for(int i=2;i*i<=n;i++)if(n%i==0)return false;  return true;} 
ll b_pow(ll x,ll n){return n ? n==1 ? x: b_pow(x,n>>1)*b_pow(x,(n>>1)+(n&1)) : 1;}
string itos(int n){stringstream ss;ss << n;return ss.str();}

//long longÉ«ðÂ¯Ä

vector< pair<int,int> > data;
map<string,int> time;
int main(){
	int n;
	while(cin >> n && n){
		data.clear();
		time.clear();
		rep(i,n){
			string a;
			int b,c;
			cin >> a >> c >> b;
			 b = (b/100) * 60 + (b%100);
			if(b >= 1440)b -= 1140 , c++;
			
			time[a] = c * 2400 + b;
		}
		vector<int> fav;
		int p;cin >> p;
		rep(i,p){
			string s;
			cin >> s;
			fav.push_back(time[s]);
			time.erase(s);
		}
		vector<int> normal;
		EACH(it,time){
			normal.push_back(it->second);
		}
		//rep(i,normal.size())data.push_back(make_pair(normal[i],1));
		//rep(i,fav.size())data.push_back(make_pair(fav[i],1));
		sort(all(fav));
		bool ok = true;
		int last = 0;
		int ans = 0;
		bool bad[19201]={0};
		rep(i,fav.size()){
			bool f = true;
			int s = fav[i];
			rep(j,30)if(bad[s+j])f = false; 
			rep(j,30)bad[s+j] = true;
			if(!f) ok = false;
			ans++;
		}
		rep(i,normal.size()){
			int s = normal[i];
			bool f = true;
			rep(j,30)if(bad[s+j])f = false; 
			rep(j,30)bad[s+j] = true;
			if(f)ans++;
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc:44:17: error: 'std::map<std::__cxx11::basic_string<char>, int> time' redeclared as different kind of entity
   44 | map<string,int> time;
      |                 ^~~~
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:9:
/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:48:17: error: reference to 'data' is ambiguous
   48 |                 data.clear();
      |                 ^~~~
In file included from /usr/include/c++/14/map:65,
                 from a.cc:6:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:43:25: note:                 'std::vector<std::pair<int, int> > data'
   43 | vector< pair<int,int> > data;
      |                         ^~~~
a.cc:49:22: error: request for member 'clear' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   49 |                 time.clear();
      |                      ^~~~~
a.cc:57:29: error: no match for 'operator[]' (operand types are 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   57 |                         time[a] = c * 2400 + b;
      |                             ^
a.cc:64:43: error: no match for 'operator[]' (operand types are 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   64 |                         fav.push_back(time[s]);
      |                                           ^
a.cc:65:30: error: request for member 'erase' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   65 |                         time.erase(s);
      |                              ^~~~~
a.cc:32:34: error: request for member 'begin' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   32 | #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
      |                                  ^~~~~
a.cc:68:17: note: in expansion of macro 'EACH'
   68 |                 EACH(it,time){
      |                 ^~~~
a.cc:32:49: error: request for member 'begin' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   32 | #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
      |                                                 ^~~~~
a.cc:68:17: note: in expansion of macro 'EACH'
   68 |                 EACH(it,time){
      |                 ^~~~
a.cc:32:65: error: request for member 'end' in 'time', which is of non-class type 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'}
   32 | #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
      |                                                                 ^~~
a.cc:68:17: note: in expansion of macro 'EACH'
   68 |                 EACH(it,time){
      |                 ^~~~
a.cc:69:44: error: base operand of '->' is not a pointer
   69 |                         normal.push_back(it->second);
      |                                            ^~