UVA 12583 - Memory Overflow

Problem PDF

Solution:

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include 
#include 
#include
#define ll long long
#define sc scanf
#define pf printf
#define Pi 2*acos(0.0)
using namespace std;
int main()
{
    char a[1000];
    int n,k,t,no=0;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d%s",&n,&k,a);
        int count=0;
        for(int i=1;i
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12583/12583.cpp