Language: C++

#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)

#define rep(i,n) for(int i = 0; i < n; i++)
#define ENDL "\n"
#define print(i) std::cout << (i) << "\n"

#define int long long // at least int64 > 9*10^18
#define all(v) v.begin(), v.end()

#define .p .first
#define .i .second

signed main() {
	int n,m;
	std::cin >> n >> m;
	std::vector<std::vector<int> > from(n,std::vector<int>());
	rep(i,m) {
		int a,b;
		std::cin >> a >> b;
		a--;b--;
		from[a].emplace_back(b);
	}
	std::vector<std::vector<int> >dist(n,std::vector<int>(3,0));
	int s,t;
	std::cin >> s >> t;
	s--;t--;
	std::queue<std::pair<int,int> > que;
	que.emplace(s,0);
	while(!que.empty()) {
		auto c = que.front();
		que.pop();
		if(c.p==t&&c.i==0) {print(dist[c.p][c.i]/3);return 0;}
		for(auto& p:from[c.p]) {
			if(dist[p][(c.i+1)%3])continue;
			dist[p][(c.i+1)%3] = dist[c.p][c.i]+1;
			que.emplace(p,(c.i+1)%3);
		}
	}
	print(-1);
	return 0;
}


Compiler output:
a.cc:24:9: error: macro names must be identifiers
   24 | #define .p .first
      |         ^
a.cc:25:9: error: macro names must be identifiers
   25 | #define .i .second
      |         ^
a.cc: In function 'int main()':
a.cc:46:22: error: 'struct std::pair<long long int, long long int>' has no member named 'p'
   46 |                 if(c.p==t&&c.i==0) {print(dist[c.p][c.i]/3);return 0;}
      |                      ^
a.cc:46:30: error: 'struct std::pair<long long int, long long int>' has no member named 'i'
   46 |                 if(c.p==t&&c.i==0) {print(dist[c.p][c.i]/3);return 0;}
      |                              ^
a.cc:46:50: error: 'struct std::pair<long long int, long long int>' has no member named 'p'
   46 |                 if(c.p==t&&c.i==0) {print(dist[c.p][c.i]/3);return 0;}
      |                                                  ^
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:46:55: error: 'struct std::pair<long long int, long long int>' has no member named 'i'
   46 |                 if(c.p==t&&c.i==0) {print(dist[c.p][c.i]/3);return 0;}
      |                                                       ^
a.cc:19:32: note: in definition of macro 'print'
   19 | #define print(i) std::cout << (i) << "\n"
      |                                ^
a.cc:47:36: error: 'struct std::pair<long long int, long long int>' has no member named 'p'
   47 |                 for(auto& p:from[c.p]) {
      |                                    ^
a.cc:48:39: error: 'struct std::pair<long long int, long long int>' has no member named 'i'
   48 |                         if(dist[p][(c.i+1)%3])continue;
      |                                       ^
a.cc:49:36: error: 'struct std::pair<long long int, long long int>' has no member named 'i'
   49 |                         dist[p][(c.i+1)%3] = dist[c.p][c.i]+1;
      |                                    ^
a.cc:49:53: error: 'struct std::pair<long long int, long long int>' has no member named 'p'
   49 |                         dist[p][(c.i+1)%3] = dist[c.p][c.i]+1;
      |                                                     ^
a.cc:49:58: error: 'struct std::pair<long long int, long long int>' has no member named 'i'
   49 |                         dist[p][(c.i+1)%3] = dist[c.p][c.i]+1;
      |                                                          ^
a.cc:50:42: error: 'struct std::pair<long long int, long long int>' has no member named 'i'
   50 |                         que.emplace(p,(c.i+1)%3);
      |                                          ^