Submission #1062528

#TimeUsernameProblemLanguageResultExecution timeMemory
1062528kunzaZa183Amusement Park (CEOI19_amusementpark)C++17
0 / 100
0 ms348 KiB
#include <algorithm> #include <bits/stdc++.h> using namespace std; #define int long long signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); int n, m; cin >> n >> m; vector<int> ht(n); vector<pair<int, int>> vpii(m); for (auto &a : vpii) { cin >> a.first >> a.second; a.first--, a.second--; } iota(ht.begin(), ht.end(), 0); int sumc = 0; const int mod = 998244353; do { for (auto a : vpii) if ((ht[a.first] > ht[a.second])) { sumc++; sumc %=mod; } } while (next_permutation(ht.begin(), ht.end())); cout << sumc << "\n"; }
#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...