300 | 2021-08-30 09:45:56 | Valaki2 | Fancy Fence | cpp14 | Wrong answer 0/100 | 29ms | 33756 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1e9 + 7;
void solve() {
ll n;
cin >> n;
ll height = 0, sum = 0;
for(int i = 0; i < n; ++i) cin >> height;
for(int i = 0; i < n; ++i) {
ll x;
cin >> x;
sum += x;
}
ll ans = 0;
ans = ((height * (height + 1)) / 2) % mod;
ans = (ans * ((sum * (sum + 1)) / 2)) % mod;
cout << ans << "\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1952 KiB | ||||
2 | Wrong answer | 2ms | 1928 KiB | ||||
subtask2 | 0/12 | ||||||
3 | Wrong answer | 1ms | 1976 KiB | ||||
4 | Wrong answer | 1ms | 1984 KiB | ||||
5 | Wrong answer | 1ms | 1984 KiB | ||||
6 | Wrong answer | 1ms | 1992 KiB | ||||
7 | Wrong answer | 1ms | 1992 KiB | ||||
subtask3 | 0/13 | ||||||
8 | Wrong answer | 2ms | 1996 KiB | ||||
9 | Wrong answer | 10ms | 2532 KiB | ||||
10 | Wrong answer | 21ms | 3756 KiB | ||||
11 | Wrong answer | 26ms | 4924 KiB | ||||
12 | Wrong answer | 21ms | 6092 KiB | ||||
subtask4 | 0/15 | ||||||
13 | Wrong answer | 2ms | 6104 KiB | ||||
14 | Wrong answer | 4ms | 6248 KiB | ||||
15 | Wrong answer | 14ms | 7212 KiB | ||||
16 | Wrong answer | 28ms | 9220 KiB | ||||
17 | Wrong answer | 29ms | 11292 KiB | ||||
subtask5 | 0/15 | ||||||
18 | Wrong answer | 2ms | 11296 KiB | ||||
19 | Wrong answer | 4ms | 11448 KiB | ||||
20 | Wrong answer | 14ms | 12540 KiB | ||||
21 | Wrong answer | 27ms | 14300 KiB | ||||
22 | Wrong answer | 26ms | 16260 KiB | ||||
subtask6 | 0/18 | ||||||
23 | Wrong answer | 1ms | 16272 KiB | ||||
24 | Wrong answer | 1ms | 16276 KiB | ||||
25 | Wrong answer | 1ms | 16288 KiB | ||||
26 | Wrong answer | 1ms | 16312 KiB | ||||
27 | Wrong answer | 1ms | 16332 KiB | ||||
subtask7 | 0/27 | ||||||
28 | Wrong answer | 3ms | 16480 KiB | ||||
29 | Wrong answer | 4ms | 16672 KiB | ||||
30 | Wrong answer | 13ms | 17508 KiB | ||||
31 | Wrong answer | 13ms | 18512 KiB | ||||
32 | Wrong answer | 25ms | 20260 KiB | ||||
33 | Wrong answer | 24ms | 22008 KiB | ||||
34 | Wrong answer | 25ms | 24020 KiB | ||||
35 | Wrong answer | 23ms | 25956 KiB | ||||
36 | Wrong answer | 1ms | 25980 KiB | ||||
37 | Wrong answer | 26ms | 27904 KiB | ||||
38 | Wrong answer | 25ms | 29864 KiB | ||||
39 | Wrong answer | 25ms | 31812 KiB | ||||
40 | Wrong answer | 25ms | 33756 KiB |