/ SeriousOJ /

Record Detail

Compile Error

foo.cc:7:10: fatal error: Ash.cpp: No such file or directory
    7 | #include "Ash.cpp"
      |          ^~~~~~~~~
compilation terminated.

Code

#include <bits/stdc++.h>

#pragma GCC optimize("Ofast")
using namespace std;

#ifndef ONLINE_JUDGE
#include "Ash.cpp"
#else
#define dbg(...)
#define dbgA(...)
#endif

void solve(int cs) {
  int n, k;
  cin >> n >> k;
  assert(n % k == 0);
  map<int,int> cnt;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    cnt[x] += 1;
  }
  int res = 0;
  int g = n / k;
  for (auto it : cnt) {
    res += it.second % g;
  }
  cout << res / 2 << "\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc = 1;
  cin >> tc;
  for (int cs = 1; cs <= tc; cs++) {
    solve(cs);
  }
  return 0;
}

Information

Submit By
Type
Submission
Problem
P1062 Roy and Array
Contest
Brain Booster #4
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-14 18:32:08
Judged At
2024-11-11 03:22:16
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes