当前位置:网站首页>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;
}
边栏推荐
- frida hook so层、protobuf 数据解析
- 【练习-5】(Uva 839)Not so Mobile(天平)
- MySQL grants the user the operation permission of the specified content
- SSM框架常用配置文件
- [exercise-3] (UVA 442) matrix chain multiplication
- 【练习4-1】Cake Distribution(分配蛋糕)
- TCP的三次握手与四次挥手
- Opencv learning log 19 skin grinding
- Nodejs+vue网上鲜花店销售信息系统express+mysql
- [exercise-7] crossover answers
猜你喜欢
Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
frida hook so层、protobuf 数据解析
入门C语言基础问答
Frida hook so layer, protobuf data analysis
C语言学习笔记
数据在内存中的存储&载入内存,让程序运行起来
Information security - threat detection - Flink broadcast stream broadcaststate dual stream merging application in filtering security logs
X-Forwarded-For详解、如何获取到客户端IP
STM32 learning record: LED light flashes (register version)
渗透测试 ( 8 ) --- Burp Suite Pro 官方文档
随机推荐
China chart recorder market trend report, technology dynamic innovation and market forecast
Information security - threat detection engine - common rule engine base performance comparison
渗透测试 ( 5 ) --- 扫描之王 nmap、渗透测试工具实战技巧合集
洛谷P1102 A-B数对(二分,map,双指针)
【练习-1】(Uva 673) Parentheses Balance/平衡的括号 (栈stack)
[exercise-9] Zombie's Treasury test
Opencv learning log 18 Canny operator
用C语言写网页游戏
[exercise-7] crossover answers
【高老师UML软件建模基础】20级云班课习题答案合集
HDU - 6024 Building Shops(女生赛)
C语言是低级和高级的分水岭
Matlab comprehensive exercise: application in signal and system
Analysis of protobuf format of real-time barrage and historical barrage at station B
[exercise-7] (UVA 10976) fractions again?! (fraction split)
【练习-5】(Uva 839)Not so Mobile(天平)
【高老师软件需求分析】20级云班课习题答案合集
Determine the Photo Position
Opencv learning log 14 - count the number of coins in the picture (regardless of overlap)
对iptables进行常规操作