当前位置:网站首页>7-1 understand everything
7-1 understand everything
2022-06-28 07:23:00 【wow_ awsl_ qwq】
7-1 Know everything.
fraction 20
author DAI, Longao
Company Hangzhou Baiteng Education Technology Co., Ltd
b3ceb051352ac65c29767cc3ecf2b21192138add.jpg
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
i
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
i
(1 ≤ M
i
≤ 200), Represents the number of characteristic data of the new graph . And then there was M
i
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;
int a[100],b[4];
bool st[1200];
int n,k;
void dfs(int t,int x)
{
if(t==4)
{
int s=0;
for(int i=0;i<4;++i)s+=b[i];
//s/=4;
st[s]=true;
return ;
}
for(int i=x;i<n;++i){
b[t]=a[i];
dfs(t+1,i+1);
}
}
int main()
{
cin>>n>>k;
for(int i=0;i<n;++i)cin>>a[i];
dfs(0,0);
while(k--)
{
int t;cin>>t;
bool flag=true;
for(int i=0;i<t;++i)
{
int x;cin>>x;
x*=4;
if(st[x]==false){
flag=false;
}
}
if(flag)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}
边栏推荐
- Wechat applets - basics takes you to understand the life cycle of applets (I)
- Practice and exploration of vivo live broadcast application technology
- Compilation principles final review
- HTTP Caching Protocol practice
- ABAP 技能树
- NDK 交叉编译
- Force buckle 515 Find the maximum value in each tree row
- R 语言 Hitters 数据分析
- 8 张图 | 剖析 Eureka 的首次同步注册表
- Recommend several 0 code, free, learning and using visualization tools
猜你喜欢

Construction and exploration of vivo database and storage platform

ABAP 技能树

MySQL installation steps - Linux configuration file JDK installation (II)

MySQL installation steps - installing MySQL on Linux (3)

MySQL installation steps - how to create a virtual machine under Linux (1)

腾讯下半年继续裁员,所有事业群至少缩减 10%,对此你怎么看?关注者

vite2.9 中指定路径别名

MySQL master-slave replication, detailed configuration, create unable to connect processing prompt

BACnet/IP網關如何采集樓宇集中控制系統數據

以动态规划的方式求解最长回文子串
随机推荐
Tencent continued to lay off staff in the second half of the year, and all business groups reduced by at least 10%. What do you think of this? Followers
Block transmission by golang gin framework
The practice of event driven architecture in vivo content platform
[C#][转载]furion框架地址和教程地址
大型项目中的Commit Message规范化控制实现
R language Kolmogorov Smirnov tests whether the two samples follow the same distribution.
Construction and exploration of vivo database and storage platform
ice - 资源
Solving the longest palindrome substring by dynamic programming
MMR rearrangement (similarity is calculated by editing distance and repeatability)
Can okcc call centers work without computers?
Compile configuration in file
2021 VDC: technological architecture evolution of vivo Internet service for 100 million users | PPT download attached
Path alias specified in vite2.9
基金的投资交易与结算
Voice network VQA: make the user's subjective experience of unknown video quality in real-time interaction known
Is it safe to open a stock trading account on your mobile phone?
在idea中,get和set方法爆红可能是没有安装Lombok插件
Spark 离线开发框架设计与实现
No suspense about the No. 1 Internet company overtime table