fork(1) download
  1. // thanh huyen neee//
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4. const int mod = 1e9 + 7;
  5. vector<int> adj[5000001];
  6. int dp[5000001];
  7. int countPaths(int u, int n) {
  8. if (dp[u] != -1) return dp[u];
  9. if (u == n)
  10. return 1;
  11. dp[u] = 0;
  12. for (int v : adj[u]) {
  13. dp[u] += countPaths(v, n)%mod;
  14. dp[u]=dp[u]%mod;
  15. }
  16. return dp[u]%mod;
  17. }
  18.  
  19. int main() {
  20. ios_base::sync_with_stdio(0);
  21. cin.tie(0); cout.tie(0);
  22. memset(dp, -1, sizeof(dp));
  23. int m, n;
  24. cin >> n >> m;
  25. for (int i = 1; i <= m; ++i) {
  26. int u, v;
  27. cin >> u >> v;
  28. adj[u].push_back(v);
  29. }
  30. cout<<countPaths(1, n)%mod;
  31. return 0;
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
4 5
1 2
2 4
1 3
3 4
1 4
compilation info
clang: error: unable to execute command: Killed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 8.0.0-3 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /home/5trKJV/prog-1e74f0.cpp
clang: note: diagnostic msg: /home/5trKJV/prog-1e74f0.sh
clang: note: diagnostic msg: 

********************
stdout
Standard output is empty