# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
19789 | xhae | 창문 (kriii4_C) | C++14 | 0 ms | 1084 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
const long long MOD = 1000000007;
long long inv(long long tar) {
long long ret = 1;
for(int i = 30; i >= 0; i--) {
ret = ret * ret % MOD;
if((1ll << i) & (MOD - 2)) ret = ret * tar % MOD;
}
return ret;
}
long long func(long long c, long long x) {
long long ret = (x * x % MOD * x % MOD * inv(3) % MOD * -1 + MOD) % MOD;
ret = (ret + x * x % MOD * c % MOD * inv(2) % MOD) % MOD;
ret = (ret + c * inv(2) % MOD * x % MOD + x * inv(3) % MOD) % MOD;
return ret;
}
int main(void) {
long long h, w;
scanf("%lld %lld", &h, &w);
h %= MOD;
w %= MOD;
long long xsum = func(w, w);
long long ysum = func(h, h);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |