Submission #19769

#TimeUsernameProblemLanguageResultExecution timeMemory
19769xdoju창문 (kriii4_C)C++14
3 / 100
0 ms1084 KiB
#include <cstdio> using namespace std; const long long MOD = 1000000007ll; long long modpow(long long r, long long n) { long long ret = 1; while (n > 0) { if (n % 2 > 0) { ret = (ret * r) % MOD; } r = (r * r) % MOD; n /= 2; } return ret; } long long modinv(long long n) { return modpow(n, MOD - 2); } long long modprod(long long a, long long b) { a = a % MOD; b = b % MOD; return (a * b) % MOD; } long long modprod(long long a, long long b, long long c) { c = c % MOD; return (modprod(a, b) * c) % MOD; } void proc() { long long h, w; scanf("%lld %lld", &h, &w); w = w % MOD; h = h % MOD; long long t = modprod(w, w + 1, w + 2); long long u = modprod(h, h + 1, h + 2); long long v = modprod(t, u); v = (v * modinv(modprod(w, w + 1))) % MOD; v = (v * modinv(modprod(h, h + 1))) % MOD; //v = modprod(v, 4, 9); printf("%lld", v); } int main() { //freopen("input.txt", "r", stdin); proc(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...