Submission #1062520

#TimeUsernameProblemLanguageResultExecution timeMemory
106252012345678Amusement Park (CEOI19_amusementpark)C++17
0 / 100
0 ms348 KiB
#include <bits/stdc++.h> using namespace std; const int nx=11, mx=1e3+5, mod=998244353; int n, m, a[mx], b[mx], res; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n>>m; for (int i=1; i<=m; i++) cin>>a[i]>>b[i]; vector<int> v; for (int i=1; i<=n; i++) v.push_back(i); do { for (int i=1; i<=m; i++) if (v[a[i]-1]>v[b[i]-1]) res=(res+1)%mod; } while (next_permutation(v.begin(), v.end())); cout<<res; }
#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...