Codefoeces 1332C ,needed help

Revision en1, by misson_specialist, 2020-04-28 08:51:46

I have read the tutorial of this problem and I haven't found any problem .But it's getting WA. I don't know why it's getting WA. I want some critical testcases. Here is my code:

include<bits/stdc++.h>

using namespace std;

define ll long long int

int n,m,i,c[100005],a,b,v,k,t[100005]; set g[100005]; vectorfirst_half; vectorsecond_half; vectortotal; int par[209],group[209]; int arra[150000]; vectorarr; map<char,int>cp; map<ll,ll>mp; dequestp1; dequestp2; map<int,int>pos; map<string,int>check; map<string,string>server; vectorans1; vectorans2; vectorans3; string server1[1009]; string ip1[1009]; string server2[1009]; string ip2[1009]; ll cashier[109]; ll fir[10009]; ll sec[100009]; ll dice[109]; vectorelement; map<ll,ll>skysc; map<string,ll>iteams; map<ll,ll>equal1; map<ll,ll>equalcnt; ll complete[200009][29]; map<ll,ll>vis_pos; map<char,ll>complete_cp; int main() { ll t; cin>>t; while(t--){ ll i,j,k,l=0,p=0,q=2019,n,r,ans=100000000,x,mini=100000000000000,maxi,z=0,total=0; string item; // cin>>n; cin>>n>>k; string stk; cin>>stk; l=n/k+1;

for(i=1;i<=l;i++) {

maxi=0;
  z=0;

for(j=0;j<=n;j=j+k)
{

  if(i+j-1<=n-1&&vis_pos[i+j-1]==0){
   complete_cp[stk[i+j-1]]++;
   maxi=max(maxi,complete_cp[stk[i+j-1]]);
   vis_pos[i+j-1]++;
   z++;
  // cout<<complete_cp[stk[i+j-1]]<<'\n';
    }
  if(j-i>=0&&vis_pos[j-i]==0){
   complete_cp[stk[j-i]]++;
   maxi=max(maxi,complete_cp[stk[j-i]]);
   // cout<<complete_cp[stk[n-(i+j)]]<<'\n';
    vis_pos[j-i]++;
    z++;
   }

} if(maxi>0) total=total+max(p,z-maxi); //cout<<maxi<<" "; // complete_cp.clear(); complete_cp.clear();

}

//cout<<n/k+n/k-maxi<<" ";

complete_cp.clear();

cout<<total<<'\n'; vis_pos.clear();

}

}

Thanks in advance..

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English misson_specialist 2020-04-28 14:15:11 74 Tiny change: 'I have rea' -> 'Problem: https://codeforces.com/contest/1332/problem/C\nI have rea'
en3 English misson_specialist 2020-04-28 09:00:17 11 Tiny change: 'y problem .But it's' -> 'y problem in my code .But it's'
en2 English misson_specialist 2020-04-28 08:53:43 1846
en1 English misson_specialist 2020-04-28 08:51:46 2119 Initial revision (published)