QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#397060 | #6785. What Kind of Friends Are You? | Lezy233# | WA | 1ms | 3876kb | C++20 | 1.1kb | 2024-04-23 16:01:33 | 2024-04-23 16:01:33 |
Judging History
answer
#include <bits/stdc++.h>
#include <bits/extc++.h>
using std::cin,std::cout,std::vector;
#define endl "\n"
typedef std::pair<int,int> PII;
void solve()
{
int n,q; cin>>n>>q;
int c; cin>>c;
vector<int>aa(c);
vector<std::string>name(c);
__gnu_pbds::gp_hash_table<std::string,int>mp;
// std::unordered_map<std::string,int>mp;
for(int i=0;i<c;++i){
cin>>name[i];
mp[name[i]]=i;
}
for(int i=0;i<q;++i){
int m; cin>>m;
while(m--){
std::string s; cin>>s;
aa[mp[s]]|=1<<i;
}
}
std::map<int,int>mp2;
for(int i=0;i<c;++i){
if(mp2.contains(aa[i])) mp2[aa[i]]=-1;
else mp2[aa[i]]=i;
}
while(n--){
int tt=0;
for(int i=0;i<q;++i){
int t; cin>>t;
if(t) tt|=1<<i;
}
if(mp2.contains(tt)&&mp2[tt]!=-1) cout<<name[mp2[tt]]<<endl;
else cout<<"Let’s go to the library!!\n";
}
}
int main()
{
cin.tie(nullptr)->sync_with_stdio(false);
int T; cin>>T;
while(T--) solve();
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3876kb
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!!'