当前位置:网站首页>CCF access control system

CCF access control system

2022-06-12 04:34:00 Python's path to becoming a God

subject  Insert picture description here

Ideas

This question is a very simple question for sending scores , You just need to record the number of occurrences each time and output them , Hash table is used here unordered_map To store .

Code

#include <iostream>
#include <unordered_map>
using namespace std;
int n;


int main() { 
    
	cin >> n;
	getchar();
	unordered_map<int, int>map;
	int temp;
	for (int i = 0; i < n; i++) { 
    
		cin>>temp;
		map[temp]++;
		cout << map[temp] << " ";
	}
	return 0;
}```

原网站

版权声明
本文为[Python's path to becoming a God]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203010941366294.html