3032021-08-30 10:10:41Valaki2Fancy Fencecpp14Wrong answer 15/10028ms33708 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 answer2ms1816 KiB
2Wrong answer2ms1852 KiB
subtask20/12
3Wrong answer1ms1936 KiB
4Wrong answer1ms1936 KiB
5Wrong answer1ms1936 KiB
6Wrong answer1ms1944 KiB
7Wrong answer1ms1948 KiB
subtask30/13
8Wrong answer2ms1952 KiB
9Wrong answer9ms2488 KiB
10Wrong answer18ms3708 KiB
11Wrong answer18ms4880 KiB
12Wrong answer18ms6048 KiB
subtask415/15
13Accepted1ms6060 KiB
14Accepted4ms6208 KiB
15Accepted13ms7172 KiB
16Accepted25ms9176 KiB
17Accepted25ms11244 KiB
subtask50/15
18Wrong answer1ms11252 KiB
19Wrong answer4ms11400 KiB
20Wrong answer14ms12364 KiB
21Wrong answer24ms14260 KiB
22Wrong answer28ms16220 KiB
subtask60/18
23Wrong answer1ms16232 KiB
24Wrong answer1ms16232 KiB
25Wrong answer2ms16248 KiB
26Wrong answer1ms16268 KiB
27Wrong answer1ms16284 KiB
subtask70/27
28Wrong answer3ms16436 KiB
29Wrong answer3ms16628 KiB
30Wrong answer12ms17592 KiB
31Wrong answer13ms18468 KiB
32Wrong answer23ms20220 KiB
33Wrong answer24ms21960 KiB
34Wrong answer25ms23972 KiB
35Wrong answer25ms25916 KiB
36Accepted1ms25940 KiB
37Wrong answer25ms27864 KiB
38Wrong answer27ms29812 KiB
39Wrong answer25ms31764 KiB
40Wrong answer25ms33708 KiB