Submission #152023

# Submission time Handle Problem Language Result Execution time Memory
152023 2019-09-06T02:14:32 Z EntityIT Homecoming (BOI18_homecoming) C++14
0 / 100
53 ms 16852 KB
#include<bits/stdc++.h>
#include "homecoming.h"

using namespace std;

using ll = long long;

ll solve(int n, int K, int *a, int *b) {
    ll ret = 0;
    vector<ll> prefB;
    for (int i = 0; i < (n << 1); ++i) prefB.push_back( (i ? prefB[i - 1] : 0) + (b[i % n]) );
    for (int i = 0; i < n; ++i) {
        ret += max( (ll)0, a[i] - prefB[i + K - 1] + (i ? prefB[i - 1] : 0) );
    }
    return ret;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 16852 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -