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 double long double
#define INF 1e18
#define DEBUG 0
#define MOD (int)(1e9 + 6)
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, W = 0, H = 0; cin >> n;
for(int i = 0; i < n; i++){
int h; cin >> h;
H = h;
H %= MOD;
}
for(int i = 0; i < n; i++){
int w; cin >> w;
W += w;
W %= MOD;
}
int temp = ((H*(H+1))/2)%MOD;
int temp2 = ((W*(W+1))/2)%MOD;
cout << (temp*temp2)%MOD;
}
# | 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... |