Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
61222 游四鑫 19从小到大进行排序 C++ Output Limit Exceeded 1 MS 660 KB 299 2023-12-03 10:26:10

Tests(0/10):


Code:

#include<iostream> using namespace std; int a[200001],b[100001]{0}; int main(){ int n,x; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; if(x<a[i])x=a[i]; b[a[i]]++; } for(int i=0;i<=x;i++){ while(b[i]>0){ cout<<i<<' '; b[i]--; } } return 0; }