提交记录 21633
用户 |
题目 |
状态 |
得分 |
用时 |
内存 |
语言 |
代码长度 |
wys |
test. 自定义测试 |
Accepted |
100 |
8.11 us |
12 KB |
C++ |
903 B |
提交时间 |
评测时间 |
2024-04-23 11:28:35 |
2024-04-23 11:28:37 |
#include <stdio.h>
#include <stdint.h>
static inline void cpuid(uint32_t eax, uint32_t ecx, uint32_t* abcd) {
asm volatile("cpuid"
: "=a"(abcd[0]), "=b"(abcd[1]), "=c"(abcd[2]), "=d"(abcd[3])
: "a"(eax), "c"(ecx));
}
int main() {
uint32_t abcd[4];
cpuid(0, 0, abcd);
uint32_t max_eax = abcd[0];
char model_name[49];
for (uint32_t i = 0x80000002; i <= 0x80000004; i++) {
cpuid(i, 0, abcd);
for (int j = 0; j < 4; j++) {
model_name[(i - 0x80000002) * 16 + j * 4 + 0] = abcd[j] & 0xff;
model_name[(i - 0x80000002) * 16 + j * 4 + 1] = (abcd[j] >> 8) & 0xff;
model_name[(i - 0x80000002) * 16 + j * 4 + 2] = (abcd[j] >> 16) & 0xff;
model_name[(i - 0x80000002) * 16 + j * 4 + 3] = (abcd[j] >> 24) & 0xff;
}
}
model_name[48] = '\0';
printf("%s\n", model_name);
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 8.11 us | 12 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-05-19 08:28:51 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用