提交时间:2022-04-10 15:45:22
运行 ID: 48188
#include <bits/stdc++.h> using namespace std; const int N(200010); const long long mod(1e9 + 7); int n,m,T; int dp[N]; vector<int> g[N]; int main() { //freopen("graph.in","r",stdin); //freopen("graph.out","w",stdout); scanf("%d %d %d", &n, &m, &T); for (int i(1); i <= m; i++) { int u, v; scanf("%d %d", &u, &v); dp[u]++; g[u].push_back(v); } long long ans(1); for (int i(1); i <= n; i++) if (dp[i]) ans *= dp[i] % mod; printf("%d\n", ans); return 0; }