3002021-08-30 09:45:56Valaki2Fancy Fencecpp14Wrong answer 0/10029ms33756 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, sum = 0;
    for(int i = 0; i < n; ++i) cin >> height;
    for(int i = 0; i < n; ++i) {
        ll x;
        cin >> x;
        sum += x;
    }
    ll ans = 0;
    ans = ((height * (height + 1)) / 2) % mod;
    ans = (ans * ((sum * (sum + 1)) / 2)) % mod;
    cout << ans << "\n";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1952 KiB
2Wrong answer2ms1928 KiB
subtask20/12
3Wrong answer1ms1976 KiB
4Wrong answer1ms1984 KiB
5Wrong answer1ms1984 KiB
6Wrong answer1ms1992 KiB
7Wrong answer1ms1992 KiB
subtask30/13
8Wrong answer2ms1996 KiB
9Wrong answer10ms2532 KiB
10Wrong answer21ms3756 KiB
11Wrong answer26ms4924 KiB
12Wrong answer21ms6092 KiB
subtask40/15
13Wrong answer2ms6104 KiB
14Wrong answer4ms6248 KiB
15Wrong answer14ms7212 KiB
16Wrong answer28ms9220 KiB
17Wrong answer29ms11292 KiB
subtask50/15
18Wrong answer2ms11296 KiB
19Wrong answer4ms11448 KiB
20Wrong answer14ms12540 KiB
21Wrong answer27ms14300 KiB
22Wrong answer26ms16260 KiB
subtask60/18
23Wrong answer1ms16272 KiB
24Wrong answer1ms16276 KiB
25Wrong answer1ms16288 KiB
26Wrong answer1ms16312 KiB
27Wrong answer1ms16332 KiB
subtask70/27
28Wrong answer3ms16480 KiB
29Wrong answer4ms16672 KiB
30Wrong answer13ms17508 KiB
31Wrong answer13ms18512 KiB
32Wrong answer25ms20260 KiB
33Wrong answer24ms22008 KiB
34Wrong answer25ms24020 KiB
35Wrong answer23ms25956 KiB
36Wrong answer1ms25980 KiB
37Wrong answer26ms27904 KiB
38Wrong answer25ms29864 KiB
39Wrong answer25ms31812 KiB
40Wrong answer25ms33756 KiB