当前位置:网站首页>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 》
边栏推荐
- Rhcsa--- day 6 operation
- Analysis report on global and Chinese pharmaceutical excipients industry competition and marketing model 2022-2028
- Uni app wechat applet customer service chat function
- HCIP Day 16
- Global and China chemical mechanical polishing abrasive materials market demand outlook and investment scale forecast report 2022 Edition
- Detailed explanation of @jsoninclude annotation in Jackson
- IQ debugging of Hisilicon platform ISP and image (1)
- Analysis report on investment and financing status and operation benefits of global and Chinese dental industry (2022 Edition)
- Exercise: completion
- Soft exam information system project manager_ Information system security management - Senior Information System Project Manager of soft test 026
猜你喜欢

Arm register (cortex-a), coprocessor and pipeline
![[open source sharing] deeply study KVM, CEPH, fuse features, including open source projects, code cases, articles, videos, architecture brain maps, etc](/img/9d/9bcf52f521e92cf97eb1d545931c68.jpg)
[open source sharing] deeply study KVM, CEPH, fuse features, including open source projects, code cases, articles, videos, architecture brain maps, etc

MySQL tuning -- 02 -- slow query log
![[Suanli network] technological innovation of Suanli Network -- Key Technologies of green and security](/img/52/7dedc5b6e213839fbf5cee3963ac99.jpg)
[Suanli network] technological innovation of Suanli Network -- Key Technologies of green and security
Linus' speech recordings, which were lost in 1994, were made public
[kicad image] download and installation

Wireless industrial Internet of things data monitoring terminal

Uni app wechat applet customer service chat function

2022-02-19: fence installation. In a two-dimensional garden, there are some trees represented by (x, y) coordinates. As the installation cost is very expensive, your task is to enclose all the trees w

Personal blog system graduation project opening report
随机推荐
Copying DNA
Investment opportunities and operational risk assessment report of China's engineering consulting industry during the 14th Five Year Plan period 2022-2028
Location object
[speech discrimination] discrimination of speech signals based on MATLAB double threshold method [including Matlab source code 1720]
Understanding the dynamic mode of mongodb document
What is the IP address
CTFSHOW
Analysis report on global and Chinese pharmaceutical excipients industry competition and marketing model 2022-2028
ctfshow-misc
Vegetables sklearn - xgboost (2)
You can't specify target table for update in from clause error in MySQL
Wechat applet simply realizes chat room function
Optimal Parking
Research Report on brand strategic management and marketing trends in the global and Chinese preserved fruit market 2022
Talk about TCP and UDP
CST8227
Folding mobile phones are expected to explode, or help Samsung compete with apple and Chinese mobile phones
Digitalization, transformation?
Analysis report on demand scale and Supply Prospect of global and Chinese thermal insulation materials market during the 14th Five Year Plan period 2022-2028
[hand torn STL] Stack & queue