Language: C++

#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

const int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }
///(?´????????`)(?´????????`)(?´????????`)(?´????????`)(?´????????`)(?´????????`)///
struct edge { int to, cap, rev, cost; };

constexpr int MAX_V = 2002;
vector<vector<edge>> G(MAX_V);
int level[MAX_V];
int iter[MAX_V];
int v[100][100];
int p[1000], l[1000];

void add_edge(int from, int to, int cap, int cost = 0) {
	G[from].push_back(edge{ to, cap, (int)G[to].size(),cost });
	G[to].push_back(edge{ from,0,(int)G[from].size() - 1,-cost });
}

void bfs(int s) {
	fill_n(level, MAX_V, -1);
	queue<int> q;
	level[s] = 0;
	q.push(s);
	while (!q.empty()) {
		int v = q.front(); q.pop();
		for (int i = 0; i < G[v].size(); i++) {
			edge &e = G[v][i];
			if (e.cap > 0 && level[e.to] < 0) {
				level[e.to] = level[v] + 1;
				q.push(e.to);
			}
		}
	}
}
ll dfs(int v, int t, int f) {
	if (v == t)return f;
	for (int &i = iter[v]; i < G[v].size(); i++) {
		edge &e = G[v][i];
		if (e.cap > 0 && level[v] < level[e.to]) {
			int d = dfs(e.to, t, min(f, e.cap));
			if (d > 0) {
				e.cap -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}
ll max_flow(int s, int t) {
	int flow = 0;
	for (;;) {
		bfs(s);
		if (level[t] < 0)return flow;
		fill_n(iter, MAX_V, 0);
		ll f;
		while ((f = dfs(s, t, INF)) > 0) {
			flow += f;
		}
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, m, l;
	while (cin >> n >> m >> l, n) {
		REP(i, n)REP(j, n)v[i][j] = INF;
		REP(i, m) {
			int a, b, c;
			cin >> a >> b >> c;
			v[a][b] = c;
			v[b][a] = c;
		}

		REP(k, n) {
			REP(i, n) {
				REP(j, n) {
					v[i][j] = min(v[i][j], v[i][k] + v[k][j]);
				}
			}
		}
		
		REP(i, l) {
			cin >> p[i] >> t[i];
		}
		REP(i, l) {
			REP(j, l) {
				if (i == j)continue;
				if (t[i] + v[p[i]][p[j]] <= t[j])add_edge(p[i] + 1, p[j] + l + 1, 1);
			}
		}
		REP(i, l)add_edge(0, i + 1, 1);
		REP(i, l)add_edge(i + l + 1, 2 * l + 1, 1);
		cout << n - max_flow(0, 2 * l + 1) << endl;
		REP(i, G.size()) {
			G[i].clear();
			level[i] = 0;
			iter[i] = 0;
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:111:40: error: 't' was not declared in this scope
  111 |                         cin >> p[i] >> t[i];
      |                                        ^
a.cc:116:37: error: 't' was not declared in this scope
  116 |                                 if (t[i] + v[p[i]][p[j]] <= t[j])add_edge(p[i] + 1, p[j] + l + 1, 1);
      |                                     ^