301 | 2021-08-30 09:52:51 | Valaki2 | Fancy Fence | cpp14 | Wrong answer 0/100 | 26ms | 33776 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;
}
ll ans = 0;
ans = ((height * (height + 1)) / 2) % mod;
ans *= ((width * (width + 1)) / 2) % mod;
ans %= 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 | 1ms | 1968 KiB | ||||
subtask2 | 0/12 | ||||||
3 | Wrong answer | 1ms | 1972 KiB | ||||
4 | Wrong answer | 1ms | 1972 KiB | ||||
5 | Wrong answer | 1ms | 1952 KiB | ||||
6 | Wrong answer | 1ms | 1976 KiB | ||||
7 | Wrong answer | 2ms | 1980 KiB | ||||
subtask3 | 0/13 | ||||||
8 | Wrong answer | 2ms | 1996 KiB | ||||
9 | Wrong answer | 9ms | 2584 KiB | ||||
10 | Wrong answer | 18ms | 3728 KiB | ||||
11 | Wrong answer | 21ms | 4900 KiB | ||||
12 | Wrong answer | 17ms | 6064 KiB | ||||
subtask4 | 0/15 | ||||||
13 | Wrong answer | 1ms | 6096 KiB | ||||
14 | Wrong answer | 4ms | 6300 KiB | ||||
15 | Wrong answer | 13ms | 7196 KiB | ||||
16 | Wrong answer | 25ms | 9240 KiB | ||||
17 | Wrong answer | 26ms | 11284 KiB | ||||
subtask5 | 0/15 | ||||||
18 | Wrong answer | 2ms | 11296 KiB | ||||
19 | Wrong answer | 4ms | 11500 KiB | ||||
20 | Wrong answer | 14ms | 12380 KiB | ||||
21 | Wrong answer | 24ms | 14332 KiB | ||||
22 | Wrong answer | 24ms | 16252 KiB | ||||
subtask6 | 0/18 | ||||||
23 | Wrong answer | 2ms | 16260 KiB | ||||
24 | Wrong answer | 1ms | 16276 KiB | ||||
25 | Wrong answer | 1ms | 16300 KiB | ||||
26 | Wrong answer | 2ms | 16312 KiB | ||||
27 | Wrong answer | 2ms | 16300 KiB | ||||
subtask7 | 0/27 | ||||||
28 | Wrong answer | 4ms | 16528 KiB | ||||
29 | Wrong answer | 3ms | 16652 KiB | ||||
30 | Wrong answer | 12ms | 17476 KiB | ||||
31 | Wrong answer | 13ms | 18576 KiB | ||||
32 | Wrong answer | 24ms | 20332 KiB | ||||
33 | Wrong answer | 24ms | 21980 KiB | ||||
34 | Wrong answer | 25ms | 24000 KiB | ||||
35 | Wrong answer | 24ms | 25964 KiB | ||||
36 | Accepted | 1ms | 25960 KiB | ||||
37 | Wrong answer | 25ms | 27896 KiB | ||||
38 | Wrong answer | 25ms | 29880 KiB | ||||
39 | Wrong answer | 24ms | 31776 KiB | ||||
40 | Wrong answer | 26ms | 33776 KiB |