# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1013525 | daffuwu | Fancy Fence (CEOI20_fancyfence) | C++14 | 16 ms | 2464 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 <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
long long n, h, w, smw;
const long long dv = 1e9+7;
long long calc(long long a, long long b)
{
if (a%2 == 0) a/=2;
else b/=2;
return a%dv*(b%dv)%dv;
}
int main()
{
long long i;
scanf("%lld", &n);
for (i=1; i<=n; i++) scanf("%lld", &h);
for (i=1; i<=n; i++)
{
scanf("%lld", &w);
smw += w;
}
printf("%lld\n", calc(smw, smw+1)*calc(h, h+1)%dv);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |