提交记录 8329
提交时间 |
评测时间 |
2019-02-12 19:15:40 |
2020-08-01 01:16:52 |
#include<iostream>
using namespace std;
int n,m,mod=1e9+7;
long long ksm(long long a,int n)
{
long long base=1;
while(n)
{
if(n%2)
base=base*a%mod;
a=a*a%mod;
n>>=1;
}
return base;
}
int main()
{
cin>>n>>m;
if(n>m)
swap(n,m);
if(n==1)
cout<<ksm(2,m);
if(n==2)
cout<<4ll*ksm(3,m-1)%mod;
if(n==3)
cout<<112ll*ksm(3,m-3)%mod;
if(n==4)
if(m==4)
cout<<"912";
else
cout<<2688ll*ksm(3,m-5)%mod;
if(n==5)
if(m==5)
cout<<"7136";
else
cout<<21321ll*ksm(3,m-6)%mod;
if(n==6)
if(m==6)
cout<<"56768";
else
cout<<170112ll*ksm(3,m-7)%mod;
if(n==7)
if(m==7)
cout<<"453504";
else
cout<<1360128ll*ksm(3,m-8)%mod;
if(n==8)
if(m==8)
cout<<"3626752";
else
cout<<10879488ll*ksm(3,m-9)%mod;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 33.97 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #2 | 42.8 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #3 | 36.39 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #4 | 35.04 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #5 | 40.72 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #6 | 34.2 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #7 | 35.43 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #8 | 35.19 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #9 | 34.91 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #10 | 34.74 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #11 | 34.93 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #12 | 35.12 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #13 | 34.36 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #14 | 34.77 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #15 | 34.2 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #16 | 34.5 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #17 | 34.87 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #18 | 35.31 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #19 | 34.06 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Testcase #20 | 34.15 us | 36 KB | Accepted | Score: 5 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:43:26 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠