303 | 2021-08-30 10:10:41 | Valaki2 | Fancy Fence | cpp14 | Wrong answer 15/100 | 28ms | 33708 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, width = 0;
for(int i = 0; i < n; ++i) cin >> height;
for(int i = 0; i < n; ++i) {
ll x;
cin >> x;
width += x;
width %= mod;
}
height = ((height * (height + 1)) / 2) % mod;
width = ((width * (width + 1)) / 2) % mod;
ll ans = (height * width) % 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 | 2ms | 1816 KiB | ||||
2 | Wrong answer | 2ms | 1852 KiB | ||||
subtask2 | 0/12 | ||||||
3 | Wrong answer | 1ms | 1936 KiB | ||||
4 | Wrong answer | 1ms | 1936 KiB | ||||
5 | Wrong answer | 1ms | 1936 KiB | ||||
6 | Wrong answer | 1ms | 1944 KiB | ||||
7 | Wrong answer | 1ms | 1948 KiB | ||||
subtask3 | 0/13 | ||||||
8 | Wrong answer | 2ms | 1952 KiB | ||||
9 | Wrong answer | 9ms | 2488 KiB | ||||
10 | Wrong answer | 18ms | 3708 KiB | ||||
11 | Wrong answer | 18ms | 4880 KiB | ||||
12 | Wrong answer | 18ms | 6048 KiB | ||||
subtask4 | 15/15 | ||||||
13 | Accepted | 1ms | 6060 KiB | ||||
14 | Accepted | 4ms | 6208 KiB | ||||
15 | Accepted | 13ms | 7172 KiB | ||||
16 | Accepted | 25ms | 9176 KiB | ||||
17 | Accepted | 25ms | 11244 KiB | ||||
subtask5 | 0/15 | ||||||
18 | Wrong answer | 1ms | 11252 KiB | ||||
19 | Wrong answer | 4ms | 11400 KiB | ||||
20 | Wrong answer | 14ms | 12364 KiB | ||||
21 | Wrong answer | 24ms | 14260 KiB | ||||
22 | Wrong answer | 28ms | 16220 KiB | ||||
subtask6 | 0/18 | ||||||
23 | Wrong answer | 1ms | 16232 KiB | ||||
24 | Wrong answer | 1ms | 16232 KiB | ||||
25 | Wrong answer | 2ms | 16248 KiB | ||||
26 | Wrong answer | 1ms | 16268 KiB | ||||
27 | Wrong answer | 1ms | 16284 KiB | ||||
subtask7 | 0/27 | ||||||
28 | Wrong answer | 3ms | 16436 KiB | ||||
29 | Wrong answer | 3ms | 16628 KiB | ||||
30 | Wrong answer | 12ms | 17592 KiB | ||||
31 | Wrong answer | 13ms | 18468 KiB | ||||
32 | Wrong answer | 23ms | 20220 KiB | ||||
33 | Wrong answer | 24ms | 21960 KiB | ||||
34 | Wrong answer | 25ms | 23972 KiB | ||||
35 | Wrong answer | 25ms | 25916 KiB | ||||
36 | Accepted | 1ms | 25940 KiB | ||||
37 | Wrong answer | 25ms | 27864 KiB | ||||
38 | Wrong answer | 27ms | 29812 KiB | ||||
39 | Wrong answer | 25ms | 31764 KiB | ||||
40 | Wrong answer | 25ms | 33708 KiB |