提交记录 2845


用户 题目 状态 得分 用时 内存 语言 代码长度
fbhou 1001a. 测测你的排序2 Compile Error 0 0 ns 0 KB C++ 884 B
提交时间 评测时间
2018-06-30 11:14:49 2020-07-31 21:07:36
#include<bits/stdc++.h>
using namespace std;
const int maxn=100010,base=1000,maxlog=3;
int x[maxn],cnt,p=1,q=1;char c;
vector<int> buck[maxlog][base];
char qu[55];int qr;
inline void print(int &x){
    if (!x) putchar(48);
    while(x) qu[++qr]=x%10+'0',x/= 10;
    while(qr) putchar(qu[qr--]);
}
inline void gi(int &x){
    for(c=getchar();c<'0'||c>'9';c=getchar());
    for(x=0;c<='9'&&c>='0';c=getchar()) x=x*10+(c&15);
}
int main(){
    for(int i=0;i<maxlog;i++)
    {
        p*=base;cnt=0;
        for(int k=0;k<base;k++) buck[i][k].clear();
        for(register int j=0;j<n;j++) buck[i][(a[j]%p)/q].push_back(a[j]);
        for(int k=0;k<base;k++)
        {
            int s=buck[i][k].size();
            for(int m=0;m<s;m++) a[cnt++]=buck[i][k][m];
        }
        q*=base;
    }
    for(register int i=0;i<n;i++){
    	print(a[i]);
    	putchar(32);
    }
    return 0;
}

CompilationN/AN/ACompile ErrorScore: N/A


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-19 17:32:06 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠