3022021-08-30 10:08:08Valaki2Fancy Fencecpp14Wrong answer 15/10039ms14804 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer2ms1828 KiB
2Wrong answer2ms1944 KiB
subtask20/12
3Wrong answer1ms1932 KiB
4Wrong answer1ms1952 KiB
5Wrong answer1ms1964 KiB
6Wrong answer1ms1936 KiB
7Wrong answer2ms1944 KiB
subtask30/13
8Wrong answer1ms1948 KiB
9Wrong answer17ms2576 KiB
10Wrong answer27ms3740 KiB
11Wrong answer19ms4896 KiB
12Wrong answer23ms6024 KiB
subtask415/15
13Accepted1ms6080 KiB
14Accepted6ms6184 KiB
15Accepted21ms7248 KiB
16Accepted26ms9188 KiB
17Accepted27ms11220 KiB
subtask50/15
18Wrong answer2ms11256 KiB
19Wrong answer4ms11452 KiB
20Wrong answer14ms12332 KiB
21Wrong answer35ms14284 KiB
22Wrong answer27ms14800 KiB
subtask60/18
23Wrong answer1ms14776 KiB
24Wrong answer1ms14776 KiB
25Wrong answer1ms14776 KiB
26Wrong answer1ms14780 KiB
27Wrong answer1ms14780 KiB
subtask70/27
28Wrong answer4ms14796 KiB
29Wrong answer4ms14776 KiB
30Wrong answer14ms14788 KiB
31Wrong answer14ms14796 KiB
32Wrong answer24ms14804 KiB
33Wrong answer35ms14796 KiB
34Wrong answer26ms14796 KiB
35Wrong answer27ms14796 KiB
36Accepted1ms14772 KiB
37Wrong answer26ms14796 KiB
38Wrong answer39ms14796 KiB
39Wrong answer28ms14796 KiB
40Wrong answer27ms14800 KiB