# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
444973 | fuad27 | Fancy Fence (CEOI20_fancyfence) | C++14 | 1 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 mod 1000000007
int main () {
long long n, a = 0;
cin >> n;
long long sumW = 0, r = 0;
for(int i = 0;i<n;i++) {
long long W;
cin >> W;
a = W;
}
for(int i = 0;i<n;i++) {
long long p;
cin >> p;
sumW += p;
sumW%=mod;
}
a%=mod;
sumW%=mod;
a*=(a+1);
a%=mod;
sumW*=(sumW+1);
sumW%=mod;
cout<<(a/2)*(sumW/2)<<endl;
}
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... |