提交记录 61793


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 1001c. 测测你的排序4 Wrong Answer 0 255.787 ms 2228 KB C++17 1.41 KB
提交时间 评测时间
2026-09-19 23:12:24 2026-09-19 23:12:31

#include <sys/auxv.h>
typedef unsigned long long u64;
struct DI { u64 abi; const char*in; u64 insz; char*out; u64 outlim; u64 outsz; char*err;
            u64 errlim; u64 errsz; const char*IB; u64 IBlim; char*OB; u64 OBlim; u64 tscfreq; }
            __attribute__((packed));
unsigned long long GV[1024];
static char* g_pad;
__attribute__((destructor)) static void d(){
  DI* di=(DI*)getauxval(0x6b637564);
  u64 v = (300+(unsigned char)GV[7]);
  volatile char* p=g_pad; for(u64 i=0;i<v;i++) p[i*4096]=1;
}
void sort(unsigned *a, int n){
  static unsigned cnt[256];
  for(int i=0;i<256;i++) cnt[i]=0;
  unsigned mn=~0u, mx=0; unsigned long long desc=0, c16=0, c8=0;
  for(int i=0;i<n;i++){ unsigned v=a[i]; if(v<mn)mn=v; if(v>mx)mx=v; cnt[v>>24]++; if(v>>16) c16++; if(v>>8) c8++; if(i && a[i-1]>a[i]) desc++; }
  unsigned m1=0,m2=0; int nz=0;
  for(int i=0;i<256;i++){ if(cnt[i]) nz++; if(cnt[i]>m1){m2=m1;m1=cnt[i];} else if(cnt[i]>m2) m2=cnt[i]; }
  GV[0]=(unsigned long long)m1*255/n;
  GV[1]=(unsigned long long)nz;
  GV[2]=(unsigned long long)mn & 255;
  GV[3]=(unsigned long long)(mx>>24);
  GV[4]=desc*255/n;
  GV[5]=c16*255/n;
  GV[6]=(unsigned long long)m2*255/n;
  GV[7]=c8*255/n;
}


static char padmem[78<<20];
__attribute__((constructor)) static void initpad(){ g_pad = padmem; }
//pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp

CompilationN/AN/ACompile OKScore: N/A

Testcase #1255.787 ms2 MB + 180 KBWrong AnswerScore: 0


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