Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
49258 | Ghost_Chris | 【AB-1】图 | C++ | 运行出错 | 0 | 3 MS | 4932 KB | 733 | 2022-05-05 13:10:30 |
#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(){ freopen("graph.in","r",stdin); freopen("graph.out","w",stdout); 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; }