#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1e9 +7;
int binpow(int a, int b){
int ans = 1;
while(b != 0){
if(b & 1){
ans = ans * a % MOD;
}
a = a * a % MOD;
b /= 2;
}
return ans;
}
signed main() {
int n;
cin >> n;
vector<int> h(n), w(n);
int cnt = 0;
for(int i = 0; i < n; i++){
cin >> h[i];
}
for(int i = 0; i < n; i++){
cin >> w[i];
cnt = (cnt + w[i]) % MOD;
}
int z = (((cnt * (cnt + 1) % MOD)* h[0]) % MOD) * (h[0] + 1) % MOD;
int g = binpow(4, MOD - 2);
z = z * g % MOD;
cout << z << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
444 KB |
Output is correct |
2 |
Correct |
10 ms |
596 KB |
Output is correct |
3 |
Correct |
36 ms |
1960 KB |
Output is correct |
4 |
Correct |
85 ms |
3788 KB |
Output is correct |
5 |
Correct |
84 ms |
3896 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |