#include<bits/stdc++.h>
using namespace std;
int t[13][13];
int main()
{
t[2][1]=2;
t[3][1]=4;
t[3][2]=2;
t[4][1]=8;
t[4][2]=16;
t[5][1]=16;
t[5][2]=100;
t[5][3]=4;
t[6][1]=32;
t[6][2]=606;
t[6][3]=82;
t[7][1]=64;
t[7][2]=3845;
t[7][3]=1131;
t[8][1]=128;
t[8][2]=26394;
t[8][3]=13798;
t[9][1]=256;
t[9][2]=197284;
t[9][3]=165180;
t[9][4]=160;
t[10][1]=512;
t[10][2]=1597767;
t[10][3]=2021081;
t[10][4]=9440;
int a,b,c;
scanf ("%d %d %d", &a, &b, &c);
printf ("%d", t[a][b]%c);
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #include<bits/stdc++.h> using namespace std; int t[13][13]; int main() { t[2][1]=2; t[3][1]=4; t[3][2]=2; t[4][1]=8; t[4][2]=16; t[5][1]=16; t[5][2]=100; t[5][3]=4; t[6][1]=32; t[6][2]=606; t[6][3]=82; t[7][1]=64; t[7][2]=3845; t[7][3]=1131; t[8][1]=128; t[8][2]=26394; t[8][3]=13798; t[9][1]=256; t[9][2]=197284; t[9][3]=165180; t[9][4]=160; t[10][1]=512; t[10][2]=1597767; t[10][3]=2021081; t[10][4]=9440; int a,b,c; scanf ("%d %d %d", &a, &b, &c); printf ("%d", t[a][b]%c); return 0; } |
English