当前位置:网站首页>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;
}
边栏推荐
- open62541直接导入NodeSet文件
- 服务器正文18:UDP可靠传输的理解和思考(读云凤博客有感)
- Path alias specified in vite2.9
- 在idea中,get和set方法爆红可能是没有安装Lombok插件
- LLVM 与 Clang
- Libuv框架echo-server.c源码详解(TCP部分)
- 2021 VDC: technological architecture evolution of vivo Internet service for 100 million users | PPT download attached
- MMR rearrangement (similarity is calculated by editing distance and repeatability)
- ice, protobuf ,thrift -- 笔记
- 自动化测试的生命周期是什么?
猜你喜欢

Modifying MySQL port number under Linux

安全培训是员工最大的福利!2022新员工入职安全培训全员篇

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

全方位透析真实企业软件测试流程

Compilation principles final review

linux下修改mysql端口号

Kubelet garbage collection (exiting containers and unused images) source code analysis

What is EC blower fan?

Practice and exploration of vivo live broadcast application technology

linux下修改mysql用户名root
随机推荐
以动态规划的方式求解最长回文子串
C语言教程大全
同花顺网上开户安全吗
力扣515.在每棵树行中找最大值
MySQL master-slave replication, detailed configuration, create unable to connect processing prompt
Block transmission by golang gin framework
我的MVVM开源项目《出行防疫App》已发布
Mysql8.0 and mysql5.0 accessing JDBC connections
R 语言 Hitters 数据分析
Makefile
Libuv框架echo-server.c源码详解(TCP部分)
Kubernetes deploys a secret pit where thanos ruler sends repeated alarms
东方财富上开户是安全的吗
什么是一致性哈希?可以应用在哪些场景?
The practice of event driven architecture in vivo content platform
Reading notes - MySQL technology l act: InnoDB storage engine (version 2)
服务器正文18:UDP可靠传输的理解和思考(读云凤博客有感)
Recommend several 0 code, free, learning and using visualization tools
【C语言】详解 C 语言获取数组长度
R 语言绘制 动画气泡图