Submission #339034

#TimeUsernameProblemLanguageResultExecution timeMemory
339034NimbostratusFishing Game (RMI19_fishing)C++17
0 / 100
3 ms512 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; ll ans; int N,T; const int MOD = 1e9 + 7; int32_t main() { //freopen("in","r",stdin); //freopen("out","w",stdout); cin >> N >> T; while(T--) { ans = 1; int lm = 0; for(int i=1;i<=3;i++) { bool added[105]; memset(added,0,sizeof(added)); for(int j=1;j<=2*N;j++) { int x; cin >> x; if(added[x]) { lm--; continue; } else { lm++; added[x] = 1; } } } lm /= 2; for(int i=1;i<=lm;i++) ans = (ans * i) % MOD; cout << ans << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...