17 lines
451 B
C
17 lines
451 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <inttypes.h>
|
|
#define show(x) printf("0x%04" PRIx16 "\t%" PRIu32 "\n", x, x)
|
|
uint32_t kapow(uint32_t x, uint32_t y) {
|
|
//for(int i = 0; i < y; i++) printf("..");
|
|
printf(" %" PRIu32 "\n",y);
|
|
if (y > 1) return kapow(x, y/2) * kapow(x, y/2 + y % 2);
|
|
else return (y>0 ? x : 1);
|
|
}
|
|
|
|
int main() {
|
|
uint32_t a, b;
|
|
scanf("%" SCNu32 "%" SCNu32, &a, &b);
|
|
show(kapow(a, b));
|
|
return 0;
|
|
} |