当前位置:网站首页>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;
}
边栏推荐
- 7-1 懂的都懂 (20 分)
- [exercise-1] (UVA 673) parentheses balance/ balanced brackets (stack)
- C 基本语法
- E. Breaking the Wall
- Market trend report, technical innovation and market forecast of geosynthetic clay liner in China
- Truck History
- Penetration test (3) -- Metasploit framework (MSF)
- 数据在内存中的存储&载入内存,让程序运行起来
- Common configuration files of SSM framework
- CS zero foundation introductory learning record
猜你喜欢
程序员的你,有哪些炫技的代码写法?
Web based photo digital printing website
Penetration test (2) -- penetration test system, target, GoogleHacking, Kali tool
Information security - threat detection - Flink broadcast stream broadcaststate dual stream merging application in filtering security logs
数据在内存中的存储&载入内存,让程序运行起来
MySQL import database error [err] 1273 - unknown collation: 'utf8mb4_ 0900_ ai_ ci’
【练习-5】(Uva 839)Not so Mobile(天平)
渗透测试 ( 5 ) --- 扫描之王 nmap、渗透测试工具实战技巧合集
TCP的三次握手与四次挥手
渗透测试 ( 1 ) --- 必备 工具、导航
随机推荐
HDU - 6024 Building Shops(女生赛)
[exercise -10] unread messages
The most complete programming language online API document
Accounting regulations and professional ethics [5]
Cost accounting [23]
Penetration test (3) -- Metasploit framework (MSF)
基于web的照片数码冲印网站
【练习-11】4 Values whose Sum is 0(和为0的4个值)
Alice and Bob (2021牛客暑期多校训练营1)
Record of force deduction and question brushing
0 - 1 problème de sac à dos (1)
Accounting regulations and professional ethics [1]
想应聘程序员,您的简历就该这样写【精华总结】
China's peripheral catheter market trend report, technological innovation and market forecast
编程到底难在哪里?
X-Forwarded-For详解、如何获取到客户端IP
Opencv learning log 31 -- background difference
China chart recorder market trend report, technology dynamic innovation and market forecast
信息安全-史诗级漏洞Log4j的漏洞机理和防范措施
D - Function(HDU - 6546)女生赛