#include <bits/stdc++.h>
using namespace std;
int main(){
long long h, w;
long long wsum = 0;
long long n; cin >> n;
for(int i = 0; i < n; i++){
cin >> h;
}
for(int i = 0; i < n; i++){
cin >> w;
wsum += w;
wsum = wsum%1000000007;
}
//ads
long long ans = wsum * (wsum+1);
ans = ans%1000000007;
ans *= h;
ans = ans%1000000007;
ans *= (h+1);
ans = ans%1000000007;
while(ans % 4 != 0){
ans += 1000000007;
}
ans /= 4;
cout << ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
8 ms |
292 KB |
Output is correct |
3 |
Correct |
48 ms |
212 KB |
Output is correct |
4 |
Correct |
76 ms |
276 KB |
Output is correct |
5 |
Correct |
73 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |