当前位置:网站首页>7-1 understand everything
7-1 understand everything
2022-07-25 22:53:00 【Panzer_ Jack】
7-1 Know everything.
author DAI, Longao
Company Hangzhou Baiteng Education Technology Co., Ltd

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 Mi 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 Mi (1 ≤ Mi ≤ 200), Represents the number of characteristic data of the new graph . And then there was Mi 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
Code length limit
16 KB
The time limit
400 ms
Memory limit
64 MB
Explain :
#include <iostream>
#include <set>
using namespace std;
int main()
{
set <int> pj;
int n,k, m[201], tz[201][201];
cin >> n >> k;
int ns[n];
for(int i=0; i<n; i++) cin >> ns[i];
for(int a=0; a<n-3; a++)
for(int b=a+1; b<n-2; b++)
for(int c=b+1; c<n-1; c++)
for(int d=c+1; d<n; d++)
pj.insert((ns[a]+ns[b]+ns[c]+ns[d]));
for(int i=0; i<k; i++)
{
cin >> m[i];
for(int j=0; j<m[i]; j++) cin >> tz[i][j];
}
for(int i=0; i<k; i++)
{
int cnt = 0;
for(int j=0; j<m[i]; j++)
for(auto p=pj.begin(); p!=pj.end(); p++) if(tz[i][j]*4 == *p) cnt++;
if(cnt == m[i]) cout << "Yes" << endl;
else cout << "No" << endl;
}
return 0;
}
边栏推荐
- Recyclerview computehorizontalscrollextend computehorizontalscrollrange computehorizontalscroll for calculating the sliding distance
- 贴片微型滚珠振动开关的结构原理
- recyclerview计算滑动距离之computeHorizontalScrollExtent-computeHorizontalScrollRange-computeHorizontalScrol
- Vs2017 compilation encountered the error HResult e returned by the call of COM component_ FAIL
- ECMA 262 12 Lexical Grammer
- Binder principle
- CSV intro
- The difference between "= =" and equals
- 【论文笔记】A Meta-Reinforcement Learning Algorithm for Causal Discovery
- ribbon 执行逻辑源码解析
猜你喜欢

We media people must have four resource tools, each of which is very practical
![[literature reading] - HRL -[hrl with universal policies for multi step robotic control]](/img/34/06d5ba3af4e6e775a335324c020161.png)
[literature reading] - HRL -[hrl with universal policies for multi step robotic control]

Binder principle

QVariant的使用

Von Neumann architecture

Session and cookie, token and storage

MySQL data type
![[文献阅读] - HRL -[HRL with Universal Policies for Multi-Step Robotic Manipulation]](/img/34/06d5ba3af4e6e775a335324c020161.png)
[文献阅读] - HRL -[HRL with Universal Policies for Multi-Step Robotic Manipulation]

Two methods of printing strings in reverse order in C language

Kibana~后台启动Kibana之后无法找到进程号
随机推荐
MySQL data type
Vodak software: Smart City solution
Tree view model example of QT
3 lexical analysis
自媒体人必备的4个资源工具,每一个都很实用
Learning orientation today
【MySQL提权】UDF提权(附带大马)
Anaconda~Upload did not complete.
Simple application of partial labels and selectors
Stack simulation queue
QVariant的使用
ECMA 262 12 Lexical Grammer
DOM event binding
Day 3 experiment
PE格式: 分析IatHook并实现
Opencv compile and call GPU version
Structure principle of micro ball vibration switch with chip
Madness. MySQL learning.
721. 账户合并 ●●、并查集
[natural language processing] [vector representation] augsbert: improve the data enhancement method of Bi encoders for paired sentence scoring tasks