3012021-08-30 09:52:51Valaki2Fancy Fencecpp14Wrong answer 0/10026ms33776 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;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer2ms1816 KiB
2Wrong answer1ms1968 KiB
subtask20/12
3Wrong answer1ms1972 KiB
4Wrong answer1ms1972 KiB
5Wrong answer1ms1952 KiB
6Wrong answer1ms1976 KiB
7Wrong answer2ms1980 KiB
subtask30/13
8Wrong answer2ms1996 KiB
9Wrong answer9ms2584 KiB
10Wrong answer18ms3728 KiB
11Wrong answer21ms4900 KiB
12Wrong answer17ms6064 KiB
subtask40/15
13Wrong answer1ms6096 KiB
14Wrong answer4ms6300 KiB
15Wrong answer13ms7196 KiB
16Wrong answer25ms9240 KiB
17Wrong answer26ms11284 KiB
subtask50/15
18Wrong answer2ms11296 KiB
19Wrong answer4ms11500 KiB
20Wrong answer14ms12380 KiB
21Wrong answer24ms14332 KiB
22Wrong answer24ms16252 KiB
subtask60/18
23Wrong answer2ms16260 KiB
24Wrong answer1ms16276 KiB
25Wrong answer1ms16300 KiB
26Wrong answer2ms16312 KiB
27Wrong answer2ms16300 KiB
subtask70/27
28Wrong answer4ms16528 KiB
29Wrong answer3ms16652 KiB
30Wrong answer12ms17476 KiB
31Wrong answer13ms18576 KiB
32Wrong answer24ms20332 KiB
33Wrong answer24ms21980 KiB
34Wrong answer25ms24000 KiB
35Wrong answer24ms25964 KiB
36Accepted1ms25960 KiB
37Wrong answer25ms27896 KiB
38Wrong answer25ms29880 KiB
39Wrong answer24ms31776 KiB
40Wrong answer26ms33776 KiB