20分,#2#3AC,其他空间超限
查看原帖
20分,#2#3AC,其他空间超限
897952
ComputerStudents楼主2024/3/14 20:17

大佬帮帮我

/*
                  _oo0oo_
                 o8888888o
                 88" . "88
                 (| -_- |)
                 O\  =  /O
              ____/`---'\___
            .' \\|      |// `.
           / //\\\  :  |||//  \
          / _||||| -:- |||||-  \
          |  | \\\  -  /// |   |
          | \_/ ''\---/''  |   |
          \  .-\__ `_`   __|-. /
        __`   '  /--.--\  `. . __
      ."" '< `.__\_</>_/__.' >'"".
      / / `- \`.;`\ _ /`;.`/ - ` : / /
      \  \ `-.\_ __\ /__ _/  .-` /  /
======`-.___`-.__\____/___.-` ___.-`======
                 `=---='
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
  佛祖保佑              再无BUG
*/
#include<bits/stdc++.h>
using namespace std;
int n,x,MAX;
int a[490000000];
int main(){
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> x;
		a[x]++;
		MAX=max(x,MAX);
	}
	for(int i=0;i<=MAX;i++){
		if(a[i]!=0){
			cout << i << ' ' << a[i] << endl;
		}
	}
	return 0;
}
2024/3/14 20:17
加载中...