#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
const int MAX_N = 1e5;
const int mod =1e9+7;
int h[MAX_N];
int w[MAX_N];
int nbp(int u){
return (u*(u+1LL)/2LL)%mod;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin>>n;
int sw = 0;
for(int i = 0; i<n; i++){
cin>>h[i];
}
for(int i = 0; i<n; i++){
cin>>w[i];
sw += w[i];
}
int res= 0;
res= (nbp(sw)*nbp(h[0]))%mod;
cout<<res<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |