TLE in "CHEFSTEP"

#include <iostream>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
	long long int t;
	cin>>t;
	while(t--)
	{
	    long long int n,k,i,d;
	    cin>>n>>k;
	    for(i=0;i<n;i++)
	    {
	        cin>>d;
	        if((d%k)==0)
	        {
	            cout<<"1";
	        }
	        else
	        {
	           cout<<"0"; 
	        }
	        
	    }
	    cout<<endl;
	}
}


plz help

use “\n” in place of endl

1 Like

It might not affect, but long long wasn’t needed too.

1 Like

Add this line for fast input

cin.tie(NULL);

You’ll get AC

2 Likes