当前位置:网站首页>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;
}
边栏推荐
- 信息安全-威胁检测引擎-常见规则引擎底座性能比较
- 快速转 TypeScript 指南
- 渗透测试 ( 4 ) --- Meterpreter 命令详解
- Penetration test (8) -- official document of burp Suite Pro
- 渗透测试 ( 1 ) --- 必备 工具、导航
- 差分(一维,二维,三维) 蓝桥杯三体攻击
- 0-1 knapsack problem (I)
- [exercise 4-1] cake distribution
- CEP used by Flink
- Perinatal Software Industry Research Report - market status analysis and development prospect forecast
猜你喜欢
渗透测试 ( 7 ) --- 漏洞扫描工具 Nessus
Determine the Photo Position
Penetration testing (5) -- a collection of practical skills of scanning King nmap and penetration testing tools
Information security - threat detection - detailed design of NAT log access threat detection platform
C语言数组的概念
1010 things that college students majoring in it must do before graduation
【高老师软件需求分析】20级云班课习题答案合集
Gartner: five suggestions on best practices for zero trust network access
程序员的你,有哪些炫技的代码写法?
C语言必背代码大全
随机推荐
[exercise-9] Zombie's Treasury test
Find 3-friendly Integers
Auto.js入门
Opencv learning log 18 Canny operator
nodejs爬虫
Research Report on surgical fluid treatment industry - market status analysis and development prospect prediction
【练习-8】(Uva 246)10-20-30==模拟
frida hook so层、protobuf 数据解析
China chart recorder market trend report, technology dynamic innovation and market forecast
Penetration testing (5) -- a collection of practical skills of scanning King nmap and penetration testing tools
Nodejs+vue网上鲜花店销售信息系统express+mysql
STM32 learning record: LED light flashes (register version)
Interesting drink
Research Report on market supply and demand and strategy of China's land incineration plant industry
信息安全-史诗级漏洞Log4j的漏洞机理和防范措施
渗透测试 2 --- XSS、CSRF、文件上传、文件包含、反序列化漏洞
D - Function(HDU - 6546)女生赛
0 - 1 problème de sac à dos (1)
Opencv learning log 12 binarization of Otsu method
[exercise-6] (UVA 725) division = = violence