当前位置:网站首页>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;
}
边栏推荐
- Severely crack down on illegal we media operators according to law: it is urgent to purify the we media industry
- Binder principle
- Today, let's talk about the if branch statement of the selection structure
- 我们为什么要推出Getaverse?
- Network Security Learning (11) scanning and blasting
- 2020-09-17
- [文献阅读] - HRL -[HRL with Universal Policies for Multi-Step Robotic Manipulation]
- Short circuit and &, short circuit or |, logic and &, logic or |; Conditional operator
- Dom and events
- 码蹄集 精准弹幕
猜你喜欢

1000个Okaleido Tiger首发上线Binance NFT,引发抢购热潮

Structure principle of micro ball vibration switch with chip

Network Security Learning (XII) OSI and TCP

Network Security Learning (XIII) data link layer

LabVIEW develops PCI-1680U dual port can card

Why should we launch getaverse?

Binder principle
![[training Day11] Nescafe [greed]](/img/4f/c9c7ae8a7b09ee58dd0fdbc55baf72.png)
[training Day11] Nescafe [greed]

JVM内存区域
![[MySQL rights] UDF rights (with Malaysia)](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[MySQL rights] UDF rights (with Malaysia)
随机推荐
Why should we launch getaverse?
PE format: analyze and implement IATHOOK
新媒体运营策略(以小红书为例)帮助你快速掌握爆款创作方法
Platform architecture construction
Network Security Learning (11) scanning and blasting
贴片微型滚珠振动开关的结构原理
[training Day11] Nescafe [greed]
Floating effect and characteristics
Day006 select structure (if statement exercise)
Network Security Learning (XII) OSI and TCP
Madness. MySQL learning.
Network Security Learning (XIV) IP protocol
Interview question 17.11. word distance ●●
[tensorflow] 关于 seed
Hcie is finally in hand, and the road begins
[literature reading] - HRL -[hrl with universal policies for multi step robotic control]
How painful is it to write unit tests?
Document flow definition, box model related knowledge
依法严厉打击违规自媒体运营者:净化自媒体行业迫在眉睫
Can generic types be used in array