标签:https continue ++ using const lse -- href ace
AcWing 3661
https://www.acwing.com/problem/content/3664/
纯暴力1-100
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 100005;
int a[N],s[105];
int T;
int n,k;
int main()
{
cin >> T;
while (T--)
{
cin >> n >> k;
for (int i = 1; i <= n; i ++ ) scanf("%d", &a[i]);
int res = (n + k - 1) / k;
for (int c = 1; c <= 100; c ++ )
{
int t = 0;
for (int i = 1; i <= n; i ++ )
{
if (c != a[i])
{
i += k - 1;
t++;
}
else continue;
}
if (t < res) res = t;
}
cout << res << endl;
}
return 0;
}
标签:https continue ++ using const lse -- href ace
原文地址:https://www.cnblogs.com/lijiaji/p/14879107.html