提交记录 21418
提交时间 |
评测时间 |
2024-03-18 17:08:23 |
2024-03-18 17:08:29 |
#include<bits/stdc++.h>
#define mod 1000000007
#define int long long
#define rep(i,a,b) for(int i(a);i<=(b);++i)
#define req(i,a,b) for(int i(a);i>=(b);--i)
using namespace std;
int ans;
int qpow(int x,int y)
{
if(y==1)return x;if(!y)return 1;
int res=qpow(x,y>>1);
return (y&1)?res*res%mod*x%mod:res*res%mod;
}
signed main()
{
int n,m;cin>>n>>m;
if(n>m)swap(n,m);
if(n==1) ans=qpow(2,m);
else if(n==2) ans=qpow(3,m-1)*4%mod;
else if(n==3) ans=qpow(3,m-3)*112%mod;
else if(n==m) ans=(qpow(8,n)*83%mod+qpow(2,n+7)*5)%mod*190104168%mod;
else ans=(qpow(8,n)*83%mod+qpow(2,n+8))%mod*qpow(3,-1+m-n)%mod*570312504%mod;
cout<<ans;
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 41.69 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #2 | 37.3 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #3 | 36.45 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #4 | 36.3 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #5 | 36.69 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #6 | 36.55 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #7 | 35.92 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #8 | 36.39 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #9 | 36.93 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #10 | 36.48 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #11 | 36.02 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #12 | 36.47 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #13 | 36.31 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #14 | 36.73 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #15 | 36.53 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #16 | 36.5 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #17 | 36.17 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #18 | 35.94 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #19 | 35.91 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #20 | 36.02 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:27:56 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠