QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#587611#6785. What Kind of Friends Are You?piggy123#WA 1ms3484kbC++203.1kb2024-09-24 20:50:232024-09-24 20:50:24

Judging History

你现在查看的是最新测评结果

  • [2024-09-24 20:50:24]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3484kb
  • [2024-09-24 20:50:23]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
using namespace std;

ll pp[505];

int main(){
	cin.tie(0);cout.tie(0);
	ios::sync_with_stdio(false);
	ll t;
	cin >> t;
	while (t--){
		ll n,q,c;
		cin >> n >> q >> c;
		for (ll i=1;i<=c;i++)pp[i]=0;
		map<string,ll> mp;
		map<ll,string> to,cp;
		map<ll,ll> cc;
		
		for (ll i=1;i<=c;i++){
			string s;
			cin >> s;
			mp[s]=i,to[i]=s;
		}
		for (ll i=1;i<=q;i++){
			ll m;
			cin >> m;
			for (ll j=1;j<=m;j++){
				string v;
				cin >> v;
				ll id=mp[v];
				pp[id]|=(1ll<<(i-1));
			}
		}
		for (ll i=1;i<=c;i++)cc[pp[i]]++,cp[pp[i]]=to[i];
		for (ll i=1;i<=n;i++){
			ll v=0;
			for (ll j=0;j<q;j++){
				ll x=0;
				cin>> x;
				v|=(x<<j);
			}
			if (cc[v]!=1){
				cout<< "Let’s go to the library!!\n";
			}else{
				cout<< cp[v]<<"\n";
			}
		}
	}
	return 0;
}

/*
                                                                
 ■■■■■     ■■      ■■■     ■■■   ■    ■     ■     ■■■■    ■■■■  
 ■   ■■    ■■     ■  ■■   ■  ■■  ■    ■    ■■     ■  ■■  ■■  ■  
 ■    ■    ■■    ■    ■  ■    ■   ■  ■    ■■■    ■■  ■■  ■   ■■ 
 ■    ■    ■■    ■    ■  ■    ■   ■  ■     ■■    ■   ■■      ■■ 
 ■    ■    ■■    ■       ■         ■■      ■■        ■■      ■  
 ■   ■■    ■■    ■  ■■■  ■  ■■■    ■■      ■■       ■■     ■■■  
 ■■■■■     ■■    ■    ■  ■    ■    ■■      ■■      ■■        ■■ 
 ■         ■■    ■    ■  ■    ■    ■■      ■■     ■■          ■ 
 ■         ■■    ■    ■  ■    ■    ■■      ■■     ■      ■   ■■ 
 ■         ■■    ■■  ■■  ■■  ■■    ■■      ■■    ■       ■■  ■■ 
 ■         ■■      ■■■■    ■■■■    ■■      ■■    ■■■■■■   ■■■■  
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3484kb

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!!'