Submission #729871

# Submission time Handle Problem Language Result Execution time Memory
729871 2023-04-24T18:25:27 Z NeroZein Homecoming (BOI18_homecoming) C++17
0 / 100
46 ms 17616 KB
#include "homecoming.h"
#include <bits/stdc++.h>
using namespace std;

long long solve(int N, int K, int *A, int *B) {
  int n, k;
  n = N, k = K; 
  vector<int> a(n), b(n);
  for (int i = 0; i < n; ++i) {
    a[i] = A[i], b[i] = B[i];
  }
  long long ans = 0; 
  for (int i = 0; i < n; ++i) {
    long long s = a[i]; 
    for (int j = 0; j < k; ++j) {
      int cur = (i + j) % n; 
      s -= b[cur]; 
    }
    ans += max(0LL, s); 
  }
  return ans; 
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 46 ms 17616 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -