当前位置:网站首页>P5594 [xr-4] simulation match
P5594 [xr-4] simulation match
2022-07-07 23:40:00 【Yuesi】
subject
X The school is in progress CSP Before the school training .
Altogether n name OIer Participate in this training , The coach carefully prepared for them m Set of simulation questions .
However , Each OIer Each has its own schedule , Coincidentally, , They are in the next k There happens to be m I'm free to play a mock race .
For the convenience of management , The coach stipulated that one must finish the game in order m Set of simulation questions .
such as , Small X In the next 2,3,5 I'm free to play a mock race , Then he must be in the 2 Tiandadi 1 Set of simulation questions , The first 3 Tiandadi 2 Set of simulation questions , The first 5 Tiandadi 3 Set of simulation questions .
The coach needs to prepare everyone for every practice match , In order to reduce the workload , If there are many people playing the same set of simulation questions on a certain day , Then the coach only needs to prepare a simulation match using this set of questions on this day .
As a computer room boss , The coach wants you to help him calculate , How many practice matches does he need to prepare every day
Input format
The first row has three integers n,m,k.
Next n That's ok , Each row m It's an integer , The first i Xing di j Integer of column ai,j
It means the first one i Personal in the next k The second day of the day j The first free day is ai,j God .
Output format
a line k It's an integer , The first i An integer represents the next i The number of simulated games the coach needs to prepare .
I/o sample
Input #1
1 3 5
2 3 5
Output #1
0 1 1 0 1
Input #2
6 3 7
2 3 4
2 5 7
3 5 7
1 3 5
5 6 7
1 2 3
Output #2
1 2 3 1 3 1 1
Input #3
10 10 20
2 3 4 8 9 11 12 16 17 18
2 3 6 10 12 13 14 15 19 20
1 3 7 10 11 13 14 15 17 19
1 2 4 6 7 9 15 17 19 20
2 3 5 6 9 11 14 16 19 20
1 2 3 8 9 10 11 12 15 19
1 4 6 7 9 12 13 17 18 19
1 7 8 9 10 11 13 15 18 20
1 5 6 7 8 9 13 16 18 19
4 5 7 10 11 13 14 17 18 20
Output #3
1 2 2 3 2 2 4 3 3 3 3 4 2 1 3 1 2 2 2 1
explain / Tips
This question adopts the bundling test .
Subtask 1(13 points):n = m = k = 1.
Subtask 2(24 points):n = 1.
Subtask 3(24 points):m = 1.
Subtask 4(39 points): No special restrictions .
about 100%100% The data of ,1 ≤ n,m,k<=10^3 ,m≤k,
1 ≤ai,1 <ai,2<⋯<a i,m≤k.
Ideas :
You can use grouping by test paper , The same column of read data indicates different test days for the same test paper ,
Just record the first occurrence of each column of days
For example, data 2 Enter the first column ( The number of days for the first set of examination papers is 1,2,3,5,6) Then this 5 At least one exam will be held every day, with one exam paper
The second column records the date of the second set of papers
#include<bits/stdc++.h>
using namespace std;
int main(){
int ans[1005][1005];
int ka[1005],num=0;
int n,m,k;//n personal ,m Empty days , in total k God
scanf("%d%d%d",&n,&m,&k);
for(int i=1;i<=n;i++){
for(int h=1;h<=m;h++){
scanf("%d",&ans[i][h]);// Save to array , Easy to count
}
}
bool b[1005]={
0};// See if there has been the same exam on the same day
int bn[1005]={
0};// Record 1-k On the same day of each day, the number of different examination papers
for(int i=1;i<=m;i++){
num=0;
for(int h=1;h<=n;h++){
if(b[ans[h][i]]==0){
bn[ans[h][i]]++;
b[ans[h][i]]=1;
ka[num]=ans[h][i];// Used for restoring and weight removal b[1000]
num++;
}
}
/* for(int i=1;i<=k;i++){ printf("%d",bn[i]); if(i<k){ printf(" "); } } printf("\n");*/ // Used to check the results or observe whether each step is correct
for(int j=0;j<num;j++){
b[ka[j]]=0;// Restore the de duplicated array
}
}
for(int i=1;i<=k;i++){
// Output final results , Note blank space
printf("%d",bn[i]);
if(i<k){
printf(" ");
}
}
return 0;
}
边栏推荐
- SRM supplier cloud collaborative management platform solution for building materials industry to realize business application scalability and configuration
- Have all the fresh students of 2022 found jobs? Is it OK to be we media?
- Benchmarking Detection Transfer Learning with Vision Transformers(2021-11)
- Anxinco esp32-a1s development board is adapted to Baidu dueros routine to realize online voice function
- IDEA 2021.3. X cracking
- 95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
- Live server usage
- Navicat connects Oracle
- 2022注册测绘师备考开始 还在不知所措?手把手教你怎么考?
- 【7.5】15. 三数之和
猜你喜欢
C # exchange number, judge to pass the exam
Class C design questions
SAP HR 社会工作经历 0023
Take you hand in hand to build feign with idea
SAP HR family member information
平衡二叉樹【AVL樹】——插入、删除
Digital procurement management system for fresh food industry: help fresh food enterprises solve procurement problems and implement online procurement throughout the process
Given an array, such as [7864, 284, 347, 7732, 8498], now you need to splice the numbers in the array to return the "largest possible number."
SAP HR social work experience 0023
[stm32+esp8266 connects to Tencent cloud IOT development platform 3] stm32+esp8266-01s dynamically registers devices on Tencent cloud (at instruction mode) -- with source code
随机推荐
Oracle string sorting
go time包常用函数
Dependency injection
2022 Season 6 perfect children's model Shaanxi finals came to a successful conclusion
List. How to achieve ascending and descending sort() 2020.8.6
One of the anti climbing methods
USB (XVI) 2022-04-28
B_QuRT_User_Guide(38)
MongoDB快速入门
Progress broadcast | all 29 shield machines of Guangzhou Metro Line 7 have been launched
Anxin can internally test offline voice module vb-01 to communicate with esp-c3-12f
Idea automatically generates serialVersionUID
SAP HR 劳动合同信息 0016
[compilation principle] lexical analysis design and Implementation
Open source hardware small project: anxinco esp-c3f control ws2812
Mobile heterogeneous computing technology - GPU OpenCL programming (basic)
Digital procurement management system for fresh food industry: help fresh food enterprises solve procurement problems and implement online procurement throughout the process
postgres timestamp转人眼时间字符串或者毫秒值
Home appliance industry channel business collaboration system solution: help home appliance enterprises quickly realize the Internet of channels
USB (XVII) 2022-04-15