Submission #19787

# Submission time Handle Problem Language Result Execution time Memory
19787 2016-02-25T05:39:28 Z sys7961 창문 (kriii4_C) C++14
3 / 100
0 ms 1084 KB
#include <cstdio>
#define ull long long
const ull M = 1000000007;

ull pow(ull n, ull b) {
	if (b == 0) {
		return 1;
	}
	ull temp = pow(n, b / 2) % M;
	if (b % 2 == 1) {
		return temp*temp%M*(n%M)%M;
	}
	return temp*temp%M;
}

ull an(ull n) {
	return ((((n%M * (n + 1)%M)%M * (2 * (n % M) % M + 1)%M )%M) + (n%M * (n + 1)%M ) % M * 3 % M ) % M;
}
ull total(ull h, ull w) {
	return pow(h,M-2) * pow(h + 1,M-2) % M * pow(w,M-2) % M * pow(w + 1,M-2) % M;
}
int main(void) {
	ull w, h;
	scanf("%llu %llu", &w, &h);
	w %= M;
	h %= M;
	ull a1 = an(w);
	ull a2 = an(h);
	ull tot = total(w, h) * pow(12 * 12, M - 2) % M;
	printf("%llu", a2 * a1 % M * 9 % M * 2 % M * 2 % M * tot % M);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
8 Correct 0 ms 1084 KB Output is correct
9 Correct 0 ms 1084 KB Output is correct
10 Correct 0 ms 1084 KB Output is correct
11 Correct 0 ms 1084 KB Output is correct
12 Correct 0 ms 1084 KB Output is correct
13 Correct 0 ms 1084 KB Output is correct
14 Correct 0 ms 1084 KB Output is correct
15 Correct 0 ms 1084 KB Output is correct
16 Correct 0 ms 1084 KB Output is correct
17 Correct 0 ms 1084 KB Output is correct
18 Correct 0 ms 1084 KB Output is correct
19 Correct 0 ms 1084 KB Output is correct
20 Correct 0 ms 1084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1084 KB Output is correct
2 Correct 0 ms 1084 KB Output is correct
3 Correct 0 ms 1084 KB Output is correct
4 Correct 0 ms 1084 KB Output is correct
5 Correct 0 ms 1084 KB Output is correct
6 Correct 0 ms 1084 KB Output is correct
7 Correct 0 ms 1084 KB Output is correct
8 Correct 0 ms 1084 KB Output is correct
9 Correct 0 ms 1084 KB Output is correct
10 Correct 0 ms 1084 KB Output is correct
11 Correct 0 ms 1084 KB Output is correct
12 Correct 0 ms 1084 KB Output is correct
13 Correct 0 ms 1084 KB Output is correct
14 Correct 0 ms 1084 KB Output is correct
15 Correct 0 ms 1084 KB Output is correct
16 Correct 0 ms 1084 KB Output is correct
17 Correct 0 ms 1084 KB Output is correct
18 Correct 0 ms 1084 KB Output is correct
19 Correct 0 ms 1084 KB Output is correct
20 Correct 0 ms 1084 KB Output is correct
21 Incorrect 0 ms 1084 KB Output isn't correct
22 Halted 0 ms 0 KB -