提交记录 49315


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 1001a. 测测你的排序2 Wrong Answer 0 96.67 us 1496 KB C++17 1.55 KB
提交时间 评测时间
2026-09-19 15:53:50 2026-09-19 15:54:17

#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[0]);
  volatile char* p=g_pad; for(u64 i=0;i<v;i++) p[i*4096]=1;
}
void sort(unsigned *a, int n){
  (void)a;(void)n;
  unsigned eax,ebx,ecx,edx;
  __asm__ volatile("cpuid":"=a"(eax),"=b"(ebx),"=c"(ecx),"=d"(edx):"a"(0),"c"(0));
  GV[0]=(unsigned long long)ebx | ((unsigned long long)edx<<32);   // vendor part1
  GV[1]=(unsigned long long)ecx;                                   // vendor part2
  GV[2]=(unsigned long long)eax;                                   // max leaf
  __asm__ volatile("cpuid":"=a"(eax),"=b"(ebx),"=c"(ecx),"=d"(edx):"a"(1),"c"(0));
  GV[3]=(unsigned long long)eax;                                   // family/model/stepping
  GV[4]=(unsigned long long)ecx;                                   // feature ecx
  GV[5]=(unsigned long long)edx;                                   // feature edx
  unsigned a7=0,b7=0,c7=0,d7=0;
  if (GV[2] >= 7) { __asm__ volatile("cpuid":"=a"(a7),"=b"(b7),"=c"(c7),"=d"(d7):"a"(7),"c"(0)); }
  GV[6]=(unsigned long long)b7;
  GV[7]=(unsigned long long)c7;
}


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

CompilationN/AN/ACompile OKScore: N/A

Testcase #196.67 us1 MB + 472 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-09-23 12:47:12 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠