#include "homecoming.h"
#include <bits/stdc++.h>
#define mk make_pair
#define sc second
#define fr first
#define pb emplace_back
#define all(s) s.begin(), s.end()
#define sz(s) ( (int)s.size() )
#define Scan(a) scanf ("%I64d", &a)
#define scan(a) scanf ("%d", &a)
using namespace std;
const int inf = (int)1e9 + 7;
const int N = (int)4e6 + 7;
long long b[N];
long long ans;
long long solve(int N, int K, int *A, int *B) {
ans = 0;
for (int i = 0; i < N; i ++)
b[i] = b[i + N] = B[i];
for (int i = 1; i < N * 2; i ++)
b[i] = b[i - 1] + b[i];
for (int i = 0; i < N; i ++) {
ans += max(0ll,A[i] - (b[i + K - 1] - (i > 0 ? b[i - 1] : 0)));
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
248 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
248 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
52 ms |
12136 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
248 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |