提交记录 5861


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah 1007. 测测你的memset Compile Error 0 0 ns 0 KB C++ 414 B
提交时间 评测时间
2018-09-04 16:55:52 2020-08-01 00:35:25
// #5630

#include <string.h>

#define size 8

typedef struct{ char buffer[size]; } Block;

void my_memset(char *a, char c, unsigned n)
{
	char *p = (char *)((int)(a + size - 1) & ~(size - 1));
	memset(a, c, p - a);
	a += n;
	memset((char *)((int)(a) & ~(size - 1)), c, (int)(a) & (size - 1));
	a = (char *)((int)(a) & ~(size - 1));
	Block b;
	memset(&b, c, size);
	for (; p != a; p += size)
		*(Block *)(p) = b;
}

CompilationN/AN/ACompile ErrorScore: N/A


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