# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
19808 |
2016-02-25T05:48:40 Z |
chan492811 |
창문 (kriii4_C) |
C++ |
|
0 ms |
1160 KB |
#include <cstdio>
#include <algorithm>
#define mod 1000000007
#define ll long long
using namespace std;
ll h,w,cnt,a,b,s,now;
ll table[10000];
void make_table(ll a){
int i;
table[0]=a%mod;
for(i=1;i<32;i++) table[i]=(table[i-1]*table[i-1])%mod;
}
ll pow(ll a,ll s){
ll i,now=1,res=1;
make_table(a);
for(i=0;s;i++){
if(s&now) res*=table[i],res%=mod,s-=now; now*=2;
}
return res;
}
int main(){
scanf("%lld %lld",&h,&w); h%=mod; w%=mod; cnt=(h*(h+1)/2)%mod; cnt*=(w*(w+1)/2)%mod; cnt%=mod; if(cnt==0) cnt=mod;
a=(((w*(w+1))%mod)*(w+2))%mod; a*=((((h*(h+1))%mod)*(h+2))%mod); a%=mod; cnt*=36; cnt%=mod; if(!cnt) cnt=mod; a*=9; a%=mod; if(!a) a=mod;
now=__gcd(a,cnt); a/=now; cnt/=now;
b=pow(cnt,mod-2);
printf("%lld",(a*b)%mod);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1160 KB |
Output is correct |
2 |
Correct |
0 ms |
1160 KB |
Output is correct |
3 |
Correct |
0 ms |
1160 KB |
Output is correct |
4 |
Correct |
0 ms |
1160 KB |
Output is correct |
5 |
Correct |
0 ms |
1160 KB |
Output is correct |
6 |
Correct |
0 ms |
1160 KB |
Output is correct |
7 |
Correct |
0 ms |
1160 KB |
Output is correct |
8 |
Correct |
0 ms |
1160 KB |
Output is correct |
9 |
Correct |
0 ms |
1160 KB |
Output is correct |
10 |
Correct |
0 ms |
1160 KB |
Output is correct |
11 |
Correct |
0 ms |
1160 KB |
Output is correct |
12 |
Correct |
0 ms |
1160 KB |
Output is correct |
13 |
Correct |
0 ms |
1160 KB |
Output is correct |
14 |
Correct |
0 ms |
1160 KB |
Output is correct |
15 |
Correct |
0 ms |
1160 KB |
Output is correct |
16 |
Correct |
0 ms |
1160 KB |
Output is correct |
17 |
Correct |
0 ms |
1160 KB |
Output is correct |
18 |
Correct |
0 ms |
1160 KB |
Output is correct |
19 |
Correct |
0 ms |
1160 KB |
Output is correct |
20 |
Correct |
0 ms |
1160 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1160 KB |
Output is correct |
2 |
Correct |
0 ms |
1160 KB |
Output is correct |
3 |
Correct |
0 ms |
1160 KB |
Output is correct |
4 |
Correct |
0 ms |
1160 KB |
Output is correct |
5 |
Correct |
0 ms |
1160 KB |
Output is correct |
6 |
Correct |
0 ms |
1160 KB |
Output is correct |
7 |
Correct |
0 ms |
1160 KB |
Output is correct |
8 |
Correct |
0 ms |
1160 KB |
Output is correct |
9 |
Correct |
0 ms |
1160 KB |
Output is correct |
10 |
Correct |
0 ms |
1160 KB |
Output is correct |
11 |
Correct |
0 ms |
1160 KB |
Output is correct |
12 |
Correct |
0 ms |
1160 KB |
Output is correct |
13 |
Correct |
0 ms |
1160 KB |
Output is correct |
14 |
Correct |
0 ms |
1160 KB |
Output is correct |
15 |
Correct |
0 ms |
1160 KB |
Output is correct |
16 |
Correct |
0 ms |
1160 KB |
Output is correct |
17 |
Correct |
0 ms |
1160 KB |
Output is correct |
18 |
Correct |
0 ms |
1160 KB |
Output is correct |
19 |
Correct |
0 ms |
1160 KB |
Output is correct |
20 |
Correct |
0 ms |
1160 KB |
Output is correct |
21 |
Correct |
0 ms |
1160 KB |
Output is correct |
22 |
Correct |
0 ms |
1160 KB |
Output is correct |
23 |
Correct |
0 ms |
1160 KB |
Output is correct |
24 |
Correct |
0 ms |
1160 KB |
Output is correct |
25 |
Correct |
0 ms |
1160 KB |
Output is correct |
26 |
Incorrect |
0 ms |
1160 KB |
Output isn't correct |
27 |
Halted |
0 ms |
0 KB |
- |