#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 + 7)
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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
656 KB |
Output is correct |
3 |
Correct |
8 ms |
1308 KB |
Output is correct |
4 |
Correct |
15 ms |
2140 KB |
Output is correct |
5 |
Correct |
16 ms |
2104 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |