# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
444996 | fuad27 | Fancy Fence (CEOI20_fancyfence) | C++14 | 1 ms | 288 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 mod 1000000007
#define int long long
int multiply(int a, int b)
{
return ((a % mod) * (b % mod)) % mod;
}
int32_t main () {
int n, m;
cin >> n;
int sumW = 0;
for(int i = 0;i<n;i++) {
int h;
cin >> h;
m = h;
m%=mod;
}
for(int i = 0;i<n;i++) {
int w;
cin >> w;
sumW += w%mod;
sumW%=mod;
}
cout<<multiply(multiply(sumW, sumW+1)/2, multiply(m, m+1)/2);
}
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... |