For this Question: You have N light bulbs, however they are currently jumbled up in wires. When you start unravelling the bulbs, you observe that the situation can be described by a directed acyclic graph connecting the bulbs to each other.

Formally, you are given a directed graph consisting of N nodes (numbered 1 to N) and M edges such that it contains no cycles. A sequence of vertices (v<sub>1</sub>, v<sub>2</sub>, ... v<sub>k</sub>) is called a path if there exists an edge from v<sub>i</sub> to v<sub>i+1</sub> for every i such that 1 ≤ i ≤ k-1. A path (v<sub>1</sub>, v<sub>2</sub>, ... v<sub>k</sub>) in the graph is called maximal, if for any vertex v, the sequence (v, v<sub>1</sub>, v<sub>2</sub>, ... v<sub>k</sub>) or (v<sub>1</sub>, v<sub>2</sub>, ... v<sub>k</sub>, v) do not represent paths in the graph. 

Find the number of maximal paths in the graph.The first line contains two integers N and M.
The next M lines each contain two integers u and v – representing an edge from vertex u to vertex v.

<b> Constraints: </b>
1 ≤ N ≤ 10<sup>5</sup>
0 ≤ M ≤ 2×10<sup>5</sup>
1 ≤ u, v ≤ N
The graph does not contain any self-loops or multiple edges.Print a single integer – the number of maximal paths.Sample Input 1:
3 1
1 2

Sample Output 1:
2

Sample Explanation 1:
The two maximal paths are (1, 2) and (3).

Sample Input 2:
3 3
1 2
2 3
1 3

Sample Output 2:
2

Sample Explanation 1:
The two maximal paths are (1, 2, 3) and (1, 3).

Sample Input 3:
3 2
1 3
3 2

Sample Output 3:
1

Sample Explanation 3:
The only maximal path is (1, 3, 2)., I have written this Solution Code: #include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
typedef long double ld;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define reads(s) string s; cin >> s;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
 
#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;}
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define setprec cout << fixed << showpoint << setprecision(20);
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
//const ll mod = 998244353;
 
vector<vector<int>> adj;
int n, m;
vector<int> visited, ans;
void dfs(int v) {
    visited[v] = true;
    for (int u : adj[v]) {
        if (!visited[u])
            dfs(u);
    }
    ans.push_back(v);
}
 
void topological_sort() {
    ans.clear();
    for (int i = 1; i <= n; ++i) {
        if (!visited[i])
            dfs(i);
    }
    reverse(ans.begin(), ans.end());
}
 
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin >> n >> m;
    adj.resize(n + 1);
    visited.resize(n + 1);
    vi d(n + 1), f(n + 1);
    FOR (i, 1, m)
    {
        readb(u, v);        
        adj[u].pb(v);
        d[v]++;
    }
 
    topological_sort();
    int sum = 0;
    for (int i: ans)
    {
        if (!d[i]) f[i] = 1;
        for (int v: adj[i]) f[v] += f[i];
        if (!sz(adj[i])) sum += f[i];
    }
 
    cout << sum;
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
, In this Programming Language: C++, Now tell me if this Code is compilable or not?