Submission #1062539

#TimeUsernameProblemLanguageResultExecution timeMemory
1062539thinknoexitAmusement Park (CEOI19_amusementpark)C++17
0 / 100
0 ms348 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 998244353; int a[155], b[155], p[22]; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n, m; cin >> n >> m; for (int i = 1;i <= m;i++) { cin >> a[i] >> b[i]; } for (int i = 1;i <= n;i++) p[i] = i; int ans = 0; do { for (int i = 1;i <= m;i++) { if (p[a[i]] > p[b[i]]) ans++; } } while (next_permutation(p + 1, p + 1 + n)); cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...