302 | 2021-08-30 10:08:08 | Valaki2 | Fancy Fence | cpp14 | Wrong answer 15/100 | 39ms | 14804 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 | 1828 KiB | ||||
2 | Wrong answer | 2ms | 1944 KiB | ||||
subtask2 | 0/12 | ||||||
3 | Wrong answer | 1ms | 1932 KiB | ||||
4 | Wrong answer | 1ms | 1952 KiB | ||||
5 | Wrong answer | 1ms | 1964 KiB | ||||
6 | Wrong answer | 1ms | 1936 KiB | ||||
7 | Wrong answer | 2ms | 1944 KiB | ||||
subtask3 | 0/13 | ||||||
8 | Wrong answer | 1ms | 1948 KiB | ||||
9 | Wrong answer | 17ms | 2576 KiB | ||||
10 | Wrong answer | 27ms | 3740 KiB | ||||
11 | Wrong answer | 19ms | 4896 KiB | ||||
12 | Wrong answer | 23ms | 6024 KiB | ||||
subtask4 | 15/15 | ||||||
13 | Accepted | 1ms | 6080 KiB | ||||
14 | Accepted | 6ms | 6184 KiB | ||||
15 | Accepted | 21ms | 7248 KiB | ||||
16 | Accepted | 26ms | 9188 KiB | ||||
17 | Accepted | 27ms | 11220 KiB | ||||
subtask5 | 0/15 | ||||||
18 | Wrong answer | 2ms | 11256 KiB | ||||
19 | Wrong answer | 4ms | 11452 KiB | ||||
20 | Wrong answer | 14ms | 12332 KiB | ||||
21 | Wrong answer | 35ms | 14284 KiB | ||||
22 | Wrong answer | 27ms | 14800 KiB | ||||
subtask6 | 0/18 | ||||||
23 | Wrong answer | 1ms | 14776 KiB | ||||
24 | Wrong answer | 1ms | 14776 KiB | ||||
25 | Wrong answer | 1ms | 14776 KiB | ||||
26 | Wrong answer | 1ms | 14780 KiB | ||||
27 | Wrong answer | 1ms | 14780 KiB | ||||
subtask7 | 0/27 | ||||||
28 | Wrong answer | 4ms | 14796 KiB | ||||
29 | Wrong answer | 4ms | 14776 KiB | ||||
30 | Wrong answer | 14ms | 14788 KiB | ||||
31 | Wrong answer | 14ms | 14796 KiB | ||||
32 | Wrong answer | 24ms | 14804 KiB | ||||
33 | Wrong answer | 35ms | 14796 KiB | ||||
34 | Wrong answer | 26ms | 14796 KiB | ||||
35 | Wrong answer | 27ms | 14796 KiB | ||||
36 | Accepted | 1ms | 14772 KiB | ||||
37 | Wrong answer | 26ms | 14796 KiB | ||||
38 | Wrong answer | 39ms | 14796 KiB | ||||
39 | Wrong answer | 28ms | 14796 KiB | ||||
40 | Wrong answer | 27ms | 14800 KiB |