Example:
Input: Number of bits: 12 Bits: 1 0 1 1 0 1 1 0 1 1 1 1 Consecutive K: 2 Output: 1 0 1 1 0 0 1 1 0 0 1 1 0 1 1 0
//JAVA CODE
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int n = sc.nextInt();int k=sc.nextInt();
int[]a = new int[n];int temp=0;
//Inputs for(int i=0;i<n;i++)
a[i]=sc.nextInt();
//print for(int i=0;i<n;i++){ System.out.print(a[i]+" "); if(a[i]==1){ temp++; if(temp==k) { System.out.print("0 "); temp=0; } } else temp=0; } } }
micsuglicze_1996 Dan Portwood https://marketplace.visualstudio.com/items?itemName=criphiveyu.Mastermine-gratuita
ReplyDeletevoilimentryt
ictrucXquido-1992 Kimberly Vaughn https://www.tampabaymomsgroup.com/profile/margartamargarta/profile
ReplyDeletebrimogistor
consmoPcan-mi Roy Gilliam click
ReplyDeleteclick
https://colab.research.google.com/drive/1_2wj-JAO-ocPE1PvPbz5sy3jAnxAM9iX
click here
conscritseca
cusubVthropta Jacobi Greene Awesome
ReplyDeleteprogram
arnolegat