提交时间:2022-05-05 13:10:39
运行 ID: 49259
#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]; inline int read(){ register int x(0); register short w(1); register char c(getchar()); for (;c < '0' || c > '9';c = getchar()) if (c == '-') w = -1; for (;c >= '0' && c <= '9';c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48); return x * w; } int main(){ n = read(),m = read(),T = read(); for (int i(1);i <= m;i++){ int u(read()),v(read()); 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; cout << ans; return 0; }