当前位置:网站首页>7-1 understand everything (20 points)
7-1 understand everything (20 points)
2022-07-06 16:03:00 【It's Xiao Zhang, ZSY】
2021 RoboCom World robot developer competition - Undergraduate group ( Preliminaries )
7-1 Know everything. (20 branch )
as everyone knows , There are many words on the Internet that are not easy to say directly , However, some vague pictures can still make netizens understand what you are talking about . However, we must still give a heavy blow to this kind of speech , So please implement a simple matching algorithm .
Now we have collected some characteristic data of the original image , from N Less than 255 Composed of nonnegative integers , Suppose that for a given number of sheets M Two are also less than 255 The characteristic data of the new graph composed of nonnegative integers , Each data can be calculated from the average of any four different data in the original figure , The new picture is called a similar picture of the original picture . For the given data , Please judge whether it's a similar picture .
Be careful , Different data does not mean different values of data , Instead, you can't take the same data multiple times . For two data with the same value , If you give it twice , You can take it twice .
Input format :
The first line of input is two integers N,K (1 ≤ N ≤ 50, 1 ≤ K ≤ 200), Indicates the number of characteristic data of the collected original drawing and the number of new drawings .
The next action N Less than 255 Non-negative integer , Represent the characteristic data of the original drawing .
final K That's ok , The first number in each line is M Represents the number of characteristic data of the new graph . And then there was M Less than 255 Non-negative integer , Represent the characteristic data of the new graph .
Output format :
For each new picture , If it is a similar picture , Output in one line Yes, Otherwise output No.
sample input :
5 3
4 8 12 20 40
3 11 16 19
3 12 16 19
10 11 11 11 11 11 11 11 11 11 11
sample output :
Yes
No
Yes
#include <bits/stdc++.h>
using namespace std;
double a[8000000],b[205],c[205];
int main(){
int m,n;
cin>>m>>n;
for(int i=0;i<m;i++){
cin>>b[i];
}
int kk=0;
for(int i=0;i<m;i++){
for(int j=i+1;j<m;j++){
for(int k=j+1;k<m;k++){
for(int h=k+1;h<m;h++){
a[kk++]=b[i]+b[j]+b[k]+b[h];
}
}
}
}
sort(a,a+kk);
while(n--){
int ss;
cin>>ss;
for(int i=0;i<ss;i++){
cin>>c[i];
}
int oo=0;
for(int i=0;i<ss;i++){
int h=lower_bound(a,a+kk,c[i]*4.0)-a;
if(a[h]!=c[i]*4.0){
oo=1;
break;
}
}
if(oo==1)
cout<<"No"<<endl;
else
cout<<"Yes"<<endl;
}
return 0;
}
边栏推荐
猜你喜欢
Analysis of protobuf format of real-time barrage and historical barrage at station B
Essai de pénétration (1) - - outils nécessaires, navigation
Ball Dropping
渗透测试 ( 4 ) --- Meterpreter 命令详解
差分(一维,二维,三维) 蓝桥杯三体攻击
mysql导入数据库报错 [Err] 1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’
STM32 learning record: LED light flashes (register version)
Frida hook so layer, protobuf data analysis
【练习-7】Crossword Answers
渗透测试 ( 1 ) --- 必备 工具、导航
随机推荐
TCP的三次握手与四次挥手
Penetration test (2) -- penetration test system, target, GoogleHacking, Kali tool
Common configuration files of SSM framework
【练习-10】 Unread Messages(未读消息)
Accounting regulations and professional ethics [2]
Ball Dropping
Shell Scripting
7-1 懂的都懂 (20 分)
Essai de pénétration (1) - - outils nécessaires, navigation
Alice and Bob (2021牛客暑期多校训练营1)
Accounting regulations and professional ethics [1]
China exterior wall cladding (EWC) market trend report, technical dynamic innovation and market forecast
[exercise-8] (UVA 246) 10-20-30== simulation
Penetration test (1) -- necessary tools, navigation
Opencv learning log 31 -- background difference
信息安全-威胁检测-NAT日志接入威胁检测平台详细设计
Interesting drink
C语言数组的概念
[exercise-7] crossover answers
[exercise -10] unread messages