当前位置:网站首页>Zhinai's database
Zhinai's database
2022-06-25 06:24:00 【CTGU-Yoghurt】
Topic link : Sign in — major IT Written interview preparation platform _ Cattle from
Ideas :
Put the serial number of the type to be marked in each row
Put together to form a string
Traverse each row
The number of string types in this row is changed each time ++
The number of output categories is the categories that can be divided according to the requirements of the topic
Then output the previous statistics in turn
Number of different kinds of concatenated strings
This is the positive solution
Code details :
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n,m,a[1010][1010];
string s[1010];
map<string,int>mp,p;
string g;
vector<int> f;
signed main()
{
cin>>n>>m;
for(int i=1;i<=m;i++)
cin>>s[i],p[s[i]]=i;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
cin>>a[i][j];
getchar();
getline(cin,g);
int o=36;
for(int i=36;i<=g.length();i++)
if(g[i]==','||g[i]==';')
f.push_back(p[g.substr(o,i-o)]),o=i+1;// Count the character segments to be distinguished
for(int i=1;i<=n;i++)
{
string s;
for(int j=0;j<f.size();j++)
{
s=s+to_string(a[i][f[j]]);// Add the character segments to be distinguished , Form new characters
}
mp[s]++;// For the composed array ++( Play the role of counting the same array )
}
cout<<mp.size()<<endl;
for(auto x:mp)
cout<<x.second<<" ";// Output mp The number of different types in each array
}
PS: Clouds want clothes, flowers want looks , The spring breeze blows over Revlon .____ Li Bai 《 Qing pingdiao · firstly 》
边栏推荐
- Ethernet
- Cat command – display the file contents on the terminal device
- Uname command – displays system information
- Soft exam information system project manager_ Management Science (Operations Research) 2--- senior information system project manager of soft test 034
- John
- Curl command – file transfer tool
- Optimal Parking
- Investment opportunities and operational risk assessment report of China's engineering consulting industry during the 14th Five Year Plan period 2022-2028
- CST8227
- Mount command - file system mount
猜你喜欢
Uni app wechat applet customer service chat function
What elements are indispensable for the development of the character? What are the stages
[network security] sharing of experience and ideas of an emergency battle
Soft exam information system project manager_ Management Science (Operations Research) 2--- senior information system project manager of soft test 034
The elephant turns around and starts the whole body. Ali pushes Maoxiang not only to Jingdong
[Suanli network] technological innovation of Suanli Network -- Key Technologies of green and security
C switch nested syntax
Understand what MSS is
Day21 performance test process
RT thread i/o device model and layering
随机推荐
At the age of 26, I was transferred to software testing with zero foundation. Now I have successfully entered the job with a monthly salary of 12K. However, no one understands my bitterness
Uni app wechat applet customer service chat function
CTFSHOW
Getting started with Silverlight development 1
Arm instructions and others
Go uses channel to control concurrency
Explain @builder usage
[v2.0] automatic update system based on motion step API (support disconnection reconnection and data compensation)
Understand what ICMP Protocol is
Fdisk command – disk partition
Viewing Chinese science and technology from the Winter Olympics (V): the Internet of things
John
Optimal Parking
HCIP Day 16
Wechat applet simply realizes chat room function
Observation configuring wmic
Analysis report on investment and financing status and operation benefits of global and Chinese dental industry (2022 Edition)
Personal blog system graduation project opening report
Day21 JMeter usage basis
Handling skills of SQL optimization (2)