Skip to content

Instantly share code, notes, and snippets.

@EsauPR
Last active November 16, 2017 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EsauPR/c06440116d89d7436c143a91c7525396 to your computer and use it in GitHub Desktop.
Save EsauPR/c06440116d89d7436c143a91c7525396 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define MOD 10000
int main(int argc, char const *argv[]) {
int N, P, result = 1;
scanf("%d %d", &N, &P);
for (int i = 0; i < P; i++) {
result = (result * (N % MOD)) % MOD;
}
printf("%d\n", result);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment