提交记录 48451
| 提交时间 |
评测时间 |
| 2026-09-19 15:07:40 |
2026-09-19 15:07:41 |
typedef unsigned long long u64;
typedef unsigned int u32;
static char pad[1<<20];
static int pages;
static void mark(int n){ volatile char* p=pad; for(int i=0;i<n;i++) p[(pages++)*4096]=1; }
static inline void dkexit(int c){ register long rax __asm__("rax")=60; register long rdi __asm__("rdi")=c; __asm__ volatile("syscall"::"a"(rax),"D"(rdi):"rcx","r11","memory"); }
static u64* dkauxv(int argc,char**argv){ char**e=argv+argc+1; while(*e)e++; return (u64*)(e+1); }
struct Rela_ { u64 o; u64 i; long a; };
extern "C" char **environ;
extern "C" int __libc_start_main(int(*m)(int,char**,char**),int c,char**v,void(*init)(void),void(*fini)(void),void(*rtld)(void),void*se){
mark(3);
char** envp=v+c+1;
mark(3);
environ = envp;
mark(3);
// TLS setup
u64* auxv = dkauxv(c,v);
u64 phdr=0,phent=0,phnum=0;
for(u64* p=auxv; p[0]; p+=2){ if(p[0]==3)phdr=p[1]; else if(p[0]==4)phent=p[1]; else if(p[0]==5)phnum=p[1]; }
mark(3);
const char* ti=0; u64 tf=0,tm=0,ta=64;
for(u64 i=0;i<phnum;i++){ const u32*ph=(const u32*)(phdr+i*phent);
if(ph[0]==7){ ti=(const char*)(((const u64*)ph)[2]); tf=((const u64*)ph)[4]; tm=((const u64*)ph)[5]; ta=((const u64*)ph)[6]; break; } }
mark(3);
if(tm){ if(ta<16)ta=16; u64 ts=(tm+ta-1)/ta*ta;
static char area[512] __attribute__((aligned(64)));
char* blk=area; char* tp=blk+ts;
for(u64 i=0;i<ts;i++) *(volatile char*)(blk+i)=0;
for(u64 i=0;i<tf;i++) *(volatile char*)(blk+ts-tf+i)=ti[i];
static void* dtv[4]; dtv[0]=(void*)1; dtv[1]=blk;
void**tcb=(void**)tp; tcb[0]=tp; tcb[1]=&dtv[0]; tcb[2]=tp; ((volatile int*)tp)[6]=0;
__asm__ volatile("wrfsbase %0"::"r"((u64)tp));
}
mark(3);
if(init) init();
mark(5);
m(c,v,envp);
mark(50);
dkexit(0);
return 0;
}
int plus(int a,int b){ mark(2); return a+b; }
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 8.8 us | 100 KB | Runtime Error | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-24 04:25:23 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠