QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#360507 | #6785. What Kind of Friends Are You? | matongc233 | WA | 0ms | 3676kb | C++14 | 1.9kb | 2024-03-21 20:44:24 | 2024-03-21 20:44:25 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 100010, MOD = 1e9 + 7;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VLL;
typedef queue<PII> QPII;
typedef stack<int> SI;
typedef vector<PII> VPII;
typedef deque<int> DPII;
typedef queue<int> QI;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
unordered_map<string, int> ump;
int t, n, q, c;
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cin >> t;
string a[210];
while (t--)
{
cin >> n >> q;
cin >> c;
int s[210][25] = {0};
for (int i = 1; i <= c; i++)
{
cin >> a[i];
ump[a[i]] = i;
}
for (int i = 0; i < q; i++)
{
int k;
cin >> k;
while(k--)
{
string op;
cin >> op;
s[ump[op]][i] = 1;
}
}
int p[210] = {0};
for (int i = 0; i < n; i++)
{
for (int j = 0; j < q; j++)
{
int w;
cin >> w;
p[i] += w*(1 << j);
}
}
int u[210] = {0};
for (int i = 1; i <= c;i++){
for (int j = 0; j < q;j++){
u[i] += s[i][j]*(1 << j) ;
}
}
for (int i = 0; i < n; i++)
{
int cnt = 0;
string res;
for (int j = 1; j <= c; j++)
{
if (p[i] == u[j])
{
cnt++;
res = a[j];
}
}
if (cnt == 1)
{
cout << res << '\n';
}
else{
cout << "Let’s go to the library!!" << '\n';
}
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3676kb
input:
2 3 4 5 Serval Raccoon Fennec Alpaca Moose 4 Serval Raccoon Alpaca Moose 1 Serval 1 Fennec 1 Serval 1 1 0 1 0 0 0 0 1 0 0 0 5 5 11 A B C D E F G H I J K 3 A B K 4 A B D E 5 A B K D E 10 A B K D E F G H I J 4 B D E K 0 0 1 1 1 1 0 1 0 1 1 1 1 1 1 0 0 1 0 1 1 0 1 1 1
output:
Serval Let’s go to the library!! Let’s go to the library!! Let’s go to the library!! Let’s go to the library!! B Let’s go to the library!! K
result:
wrong answer 2nd lines differ - expected: 'Let's go to the library!!', found: 'Let’s go to the library!!'