nihonium
/
mipt_clang
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

28 lines
394 B
C

#include <stdio.h>
#include <stdlib.h>
int main() {
unsigned N, i, page_n, log;
scanf("%u", &N);
unsigned *mem = (unsigned*)calloc(N, sizeof(unsigned));
for (i = 0; i < N; ++i) {
scanf("%x", &mem[i]);
}
scanf("%x", &log);
page_n = (log >> 26) & 0b111111;
if (page_n < N) {
printf("%x", mem[page_n]+(log << 6 >> 6));
}
else {
printf("error");
}
free(mem);
return 0;
}