首页 > 其他 > 详细

PAT散列题---1038 统计同成绩学生 (20分)

时间:2020-06-11 20:30:43      阅读:31      评论:0      收藏:0      [点我收藏+]

1038 统计同成绩学生 (20分)

#include<iostream>
#include<vector>
#include<cctype>
#include<algorithm>
#include<sstream>
#include<string>
#include<cstdio>
const int maxn=100010;
using namespace std;

int cnt[maxn];
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	std::cout.tie(0);
	int n;cin>>n;
	while(n--){
		int x;cin>>x;
		cnt[x]++;
	}
	int k;cin>>k;
	for(int i=0;i<k;i++){
		int x;cin>>x;
		if(i) cout<<" ";
		cout<<cnt[x];
	}
	return 0;
}


PAT散列题---1038 统计同成绩学生 (20分)

原文:https://www.cnblogs.com/bingers/p/13095516.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!