Advertisement

CSP试题回顾分析灰度直方图(优化版)

阅读量:

CSP-202104-1-灰度直方图

解题代码

复制代码
    #include <iostream>
    #include <vector>
    using namespace std;
    
    long long m, n, t, L;
    
    int main() {
    	cin >> n >> m >> L;
    	vector<long long>pic(L, 0);
    	for (size_t i = 0; i < n * m; i++)
    	{
    		cin >> t;
    		pic[t]++;
    	}
    	for (auto& it : pic) 
    	{
    		cout << it << " ";
    	}
    return 0;
    }
    
    
    
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      

全部评论 (0)

还没有任何评论哟~