Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(a) (a).begin(),(a).end()
#define EQ(a,b) (abs((a)-(b)) < EPS)
using namespace std;
typedef long double D;
typedef complex<D> P;
typedef pair<int,int> pii;
typedef pair<D, pii> data;
typedef vector<int> vi;

const D EPS = 1e-10;
const D PI = acos(-1);
const D INF = 1e15;

class UF{
  vi parent,rank;

public:
  UF(int n):parent(n,-1),rank(n,0){ }

  int find(int x){ return (parent[x]<0)?x:(parent[x] = find(parent[x])); }

  void unite(int x,int y){
    x = find(x); y = find(y);
    if(x==y)return;

    if(rank[x] < rank[y])parent[x] = y;
    else parent[y] = x;
    if(rank[x] == rank[y])rank[x]++;
  }

  bool same(int x,int y){return find(x)==find(y);}
};

int n;
string name[110];
D T,r,x[110],y[110],t[110][1100];
D vx[110][1100], vy[110][1100];

vector<D> cal(int a, int b){
  //cerr << a << " " << b << endl;
  vector<D> res;

  P pa = P(x[a],y[a]), pb = P(x[b],y[b]);
  if( abs(pa-pb)<r+EPS )res.push_back(0);

  int ta=1, tb=1;
  D cur = 0, nxt = min(t[a][ta],t[b][tb]);
  while(!EQ(cur,T)){
    D tx = pa.real() - pb.real(), ty = pa.imag() - pb.imag();
    D tvx = vx[a][ta] - vx[b][tb], tvy = vy[a][ta] - vy[b][tb];
    //cerr << vx[a][ta] << " " << vy[a][ta] << " " << vx[b][tb] << " " << vy[b][tb] << endl;
    D A = tvx*tvx + tvy*tvy, B = 2*tvx*tx + 2*tvy*ty, C = tx*tx + ty*ty - r*r;
    D d = B*B - 4*A*C;
    vector<D> sol;

    //cerr << A << " " << B << " " << C << endl;
    if(EQ(A,0)){
      if(!EQ(B,0))sol.push_back(-C/B);
    }else if(EQ(d,0)){
      sol.push_back(-B/2/A);
    }else if(d>EPS){
      sol.push_back( (-B - sqrt(d))/2/A );
      sol.push_back( (-B + sqrt(d))/2/A );
    }

    rep(i,sol.size()){
      //cerr << sol[i] << endl;
      if(sol[i]+EPS < 0 || nxt-cur+EPS < sol[i])continue;
      res.push_back(cur + sol[i]);
    }

    cur = nxt;
    if(EQ(t[a][ta],cur)){
      D dif = t[a][ta] - t[a][ta-1];
      pa += P(vx[a][ta]*dif, vy[a][ta]*dif);
      ta++;
    }
    if(EQ(t[b][tb],cur)){
      D dif = t[b][tb] - t[b][tb-1];
      pb += P(vx[b][tb]*dif, vy[b][tb]*dif);
      tb++;
    }
    nxt = min(t[a][ta],t[b][tb]);
  }
  return res;
}

int main(){
  cin.tie(0); ios::sync_with_stdio(0);
  while(cin >> n >> T >> r){
    if(n==0)break;
   
    rep(i,n){
      cin >> name[i];
      cin >> t[i][0] >> x[i] >> y[i];
      for(int j=0;;j++){
	cin >> t[i][j+1] >> vx[i][j+1] >> vy[i][j+1];
	if(EQ(t[i][j+1], T))break;
      }
    }

    vector<data> event;
    rep(i,n)rep(j,i){
      vector<D> sub_event = cal(i,j);
      for(D d : sub_event){
	event.push_back(data(d, pii(i,j)));
      }
    }
    sort(all(event));
    /*
    rep(i,event.size()){
      cerr << event[i].first << " " << event[i].second.first << " " << event[i].second.second << endl;
    }
    */

    bool prop[110];
    memset(prop,0,sizeof(prop));
    prop[0] = true;

    rep(i,event.size()){
      if(event[i].first>T+EPS)break;

      UF uf(n);
      uf.unite(event[i].second.first,event[i].second.second);
      while(i<(int)event.size() && EQ(event[i].first,event[i+1].first)){
	i++;
	uf.unite(event[i].second.first,event[i].second.second);
      }

      bool group[110];
      memset(group,0,sizeof(group));
      rep(j,n){
	if(prop[j])group[uf.find(j)] = true;
      }

      //rep(j,n)cerr << group[j] << " "; cerr << endl;

      rep(j,n){
	if(group[uf.find(j)])prop[j] = true;
      }
    }
    
    vector<string> ans;
    rep(i,n){
      if(prop[i])ans.push_back(name[i]);
    }
    sort(all(ans));
    for(string s : ans)cout << s << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:104:16: error: template argument 1 is invalid
  104 |     vector<data> event;
      |                ^
a.cc:104:16: error: template argument 2 is invalid
a.cc:108:15: error: request for member 'push_back' in 'event', which is of non-class type 'int'
  108 |         event.push_back(data(d, pii(i,j)));
      |               ^~~~~~~~~
a.cc:108:25: error: reference to 'data' is ambiguous
  108 |         event.push_back(data(d, pii(i,j)));
      |                         ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/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:9:22: note:                 'typedef struct std::pair<long double, std::pair<int, int> > data'
    9 | typedef pair<D, pii> data;
      |                      ^~~~
a.cc:3:20: error: request for member 'begin' in 'event', which is of non-class type 'int'
    3 | #define all(a) (a).begin(),(a).end()
      |                    ^~~~~
a.cc:111:10: note: in expansion of macro 'all'
  111 |     sort(all(event));
      |          ^~~
a.cc:3:32: error: request for member 'end' in 'event', which is of non-class type 'int'
    3 | #define all(a) (a).begin(),(a).end()
      |                                ^~~
a.cc:111:10: note: in expansion of macro 'all'
  111 |     sort(all(event));
      |          ^~~
a.cc:122:17: error: request for member 'size' in 'event', which is of non-class type 'int'
  122 |     rep(i,event.size()){
      |                 ^~~~
a.cc:2:38: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                                      ^
a.cc:123:15: error: invalid types 'int[int]' for array subscript
  123 |       if(event[i].first>T+EPS)break;
      |               ^
a.cc:126:21: error: invalid types 'int[int]' for array subscript
  126 |       uf.unite(event[i].second.first,event[i].second.second);
      |                     ^
a.cc:126:43: error: invalid types 'int[int]' for array subscript
  126 |       uf.unite(event[i].second.first,event[i].second.second);
      |                                           ^
a.cc:127:26: error: request for member 'size' in 'event', which is of non-class type 'int'
  127 |       while(i<(int)event.size() && EQ(event[i].first,event[i+1].first)){
      |                          ^~~~
a.cc:127:44: error: invalid types 'int[int]' for array subscript
  127 |       while(i<(int)event.size() && EQ(event[i].first,event[i+1].first)){
      |                                            ^
a.cc:4:23: note: in definition of macro 'EQ'
    4 | #define EQ(a,b) (abs((a)-(b)) < EPS)
      |                       ^
a.cc:127:59: error: invalid types 'int[int]' for array subscript
  127 |       while(i<(int)event.size() && EQ(event[i].first,event[i+1].first)){
      |                                                           ^
a.cc:4:27: note: in definition of macro 'EQ'
    4 | #define EQ(a,b) (abs((a)-(b)) < EPS)
      |                           ^
a.cc:129:23: error: invalid types 'int[int]' for array subscript
  129 |         uf.unite(event[i].second.first,event[i].second.second);
      |                       ^
a.cc:129:45: error: invalid types 'int[int]' for array subscript
  129 |         uf.unite(event[i].second.first,event[i].second.second);
      |                                             ^