# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
339034 | Nimbostratus | Fishing Game (RMI19_fishing) | C++17 | 3 ms | 512 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |