Whenever i submit my solution it always shows ( Submission Queued... ) and not giving me the result

My issue

My code

#include <bits/stdc++.h>
using namespace std;
int main() {
	int x;
	cin>>x;
	while(x!=0){
	    int a,b;
	    cin>>a>>b;
	    int arr[a];
	    for(int i=0;i<a;i++){
	        cin>>arr[i];
	    }
	    bool flag=false;
	    for(int i=0;i<a-b;i++){
	        for(int j=i+b;j<a;j++){
	            if(arr[i]>arr[j]){
	                int w=arr[i];
	                arr[i]=arr[j];
	                arr[j]=w;
	                flag=true;
	                break;
	            }
	        }
	        if(flag){
	            break;
	        }
	    }
	    for(int i=0;i<a;i++){
	        cout<<arr[i]<<" ";
	    }
	    cout<<endl;
	    x-=1;
	}
	return 0;
}

Problem Link: SWAPNUM31 Problem - CodeChef

1 Like

Same here too . :slightly_smiling_face: :slightly_smiling_face:

Problem Link: Easy Pronunciation - Problems - CodeChef

1 Like