# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
628687 | a_aguilo | Fancy Fence (CEOI20_fancyfence) | C++14 | 96 ms | 476 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;
int MOD = 1e9 + 7;
int main(){
int n, h, w;
cin >> n;
long long int H = 0;
for(int i = 0; i < n; ++i){
cin >> H;
}
long long int W = 0;
for(int i = 0; i < n; ++i){
cin >> w;
W += w;
W%=MOD;
}
long long chooseh = (H*(H+1)/2)%MOD;
long long choosew = (W*(W+1)/2)%MOD;
cout << (chooseh*choosew)%MOD << endl;
return 0;
}
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... |