# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
444993 | fuad27 | Fancy Fence (CEOI20_fancyfence) | C++14 | 1085 ms | 204 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 int long long
#define mod 1000000007
int M(int a, int b) {
a%=mod;
b%=mod;
int sum = 0;
for(int i = 0;i<b;i++) {
sum+=a;
sum%=mod;
}
return sum;
}
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<<M(M(sumW%mod, (sumW+1)%mod), M(m%mod, (m+1)%mod))/4<<"\n";
}
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... |