RamanMalhotra's blog

By RamanMalhotra, history, 6 years ago, In English

can anyone tell whats wrong in this code? import java.util.*; public class Rssss { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt();int count=0; ArrayList arr=new ArrayList<>(); long a=sc.nextLong(); for(int i=1;i<=n;i++) { int v=sc.nextInt(); for(int j=0;j<v;j++) { long c=sc.nextLong(); if(c<a){arr.add(i);count++;break;}

    }
}

if(count>0){
    System.out.println(count);
    for(int i=0;i<arr.size();i++)
    {
        System.out.print(arr.get(i)+" ");
    }
}
else{
    System.out.println("0");
}




}

}

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By RamanMalhotra, history, 6 years ago, In English

should i start cp

Full text and comments »

  • Vote: I like it
  • -18
  • Vote: I do not like it