이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |