提交记录 35006
| 提交时间 |
评测时间 |
| 2026-08-15 00:20:07 |
2026-08-15 00:21:22 |
#include <stdio.h>
#define MOD 1000000007
long long powmod(long long b, long long e){
long long r=1; b%=MOD;
while(e){ if(e&1) r=r*b%MOD; b=b*b%MOD; e>>=1; }
return r;
}
static int tab[9][9];
void init(){
tab[3][1]=8; tab[3][2]=36; tab[3][3]=112; tab[3][4]=336; tab[3][5]=1008; tab[3][6]=3024; tab[3][7]=9072; tab[3][8]=27216;
tab[4][1]=16; tab[4][2]=108; tab[4][3]=336; tab[4][4]=912; tab[4][5]=2688; tab[4][6]=8064; tab[4][7]=24192; tab[4][8]=72576;
tab[5][1]=32; tab[5][2]=324; tab[5][3]=1008; tab[5][4]=2688; tab[5][5]=7136; tab[5][6]=21312; tab[5][7]=63936; tab[5][8]=191808;
tab[6][1]=64; tab[6][2]=972; tab[6][3]=3024; tab[6][4]=8064; tab[6][5]=21312; tab[6][6]=56768; tab[6][7]=170112; tab[6][8]=510336;
tab[7][1]=128; tab[7][2]=2916; tab[7][3]=9072; tab[7][4]=24192; tab[7][5]=63936; tab[7][6]=170112; tab[7][7]=453504; tab[7][8]=1360128;
tab[8][1]=256; tab[8][2]=8748; tab[8][3]=27216; tab[8][4]=72576; tab[8][5]=191808; tab[8][6]=510336; tab[8][7]=1360128; tab[8][8]=10879488;
}
int main(){
init();
int n,m; scanf("%d%d",&n,&m);
if(n>m){ int t=n; n=m; m=t; }
long long ans;
if(n==1) ans = powmod(2,m);
else if(n==2) ans = 4*powmod(3,m-1)%MOD;
else if(m<=8) ans = tab[n][m];
else ans = tab[n][8]*powmod(3,m-8)%MOD;
printf("%lld\n", ans);
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 10.9 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #2 | 9.21 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #3 | 7.85 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #4 | 8.14 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #5 | 8.54 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #6 | 7.67 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #7 | 8.34 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #8 | 8.07 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #9 | 8.48 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #10 | 7.99 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #11 | 8.22 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #12 | 8.32 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #13 | 8.19 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #14 | 8.41 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #15 | 8.51 us | 16 KB | Accepted | Score: 5 | 显示更多 |
| Testcase #16 | 8.05 us | 16 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #17 | 7.93 us | 16 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #18 | 8.03 us | 16 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #19 | 8.17 us | 16 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #20 | 8.31 us | 16 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-08 12:48:07 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠