Comments

I don't know . I mean I got notified about the statement change

-13

j

3rd question , my good God . what was that even . I just couldn't understand . I spent my entire time trying to break down that question .

Can anyone please suggest a platform or a discord server where we can interact with people about Competitive Programming ? Please , I haven't any community like this , help a brother out .

On Kevin114514 → I'm Kevin114514, AMA!, 3 years ago
0

Any discord servers for CP , please? Anything will do , I'm a loner and I need to find someone to do CP with

On Kevin114514 → I'm Kevin114514, AMA!, 3 years ago
0

Kevin , when you started out CP , were you already well trained in DSA?

import java.util.*;

public class A_Vasya_and_Coins {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int t = sc.nextInt();
        while(t-->0)
        {
            int a = sc.nextInt();
            int b = sc.nextInt();

            int a1 = a*1;
            int a2 = b*2;

            if(a==0)
            System.out.println(1);
            else 
            {

            int ans = (a1+a2) + 1;

            System.out.println(ans);
            }


        }
    }
}

nice

On Kevin114514 → I'm Kevin114514, AMA!, 3 years ago
0

I'm 22 and Indian . I regret not knowing about CP before . Congratulations on reaching LGM at such a young age . I'll also work really hard to atleast reach orange . Did you use Codemao classes to train ? What is the name of your training institute ? Do they provide online training ? I want to really really really get better at this and because I'm on my own. It's not helping at all . Any mentors , please ?

On Kevin114514 → I'm Kevin114514, AMA!, 3 years ago
0

Oh okay . Thanks

On Kevin114514 → I'm Kevin114514, AMA!, 3 years ago
0

What is MO ?

Can someone please explain B solution in Java?

import java.util.*;
import java.util.Collections;
 
public class Main
{
    public static void main(String[] args)
    {
      Scanner sc = new Scanner(System.in);
      int m = sc.nextInt();
      int n = sc.nextInt();
      
      char arr[][] = new char[m][n];
      Boolean flag = false;
      
      for(int i = 0 ;i<m;i++)
      {
          for(int j = 0 ;j<n;j++)
          {
              
              arr[i][j] = sc.next().charAt(0);
              
              if(arr[i][j] == 'C' || arr[i][j] == 'M' || arr[i][j] == 'Y' )
              { 
                flag = true;
                break;
              }
               else 
               flag = false;
               continue;
          }
          
      }
       
      if(flag)
       System.out.println("#Color");
       else
       System.out.println("#Black&White");
	}
	}

Failing on test 30 . Can anyone help me , please?

well I found how stupid , I was , Thanks for not replying everyone .

import java.util.*;
import java.util.Collections;

public class Main
{
  public static void main (String[]args)
  {
    Scanner sc = new Scanner (System.in);
    int n = sc.nextInt ();
    int ans = 0;
    Map<Integer,Integer> map = new HashMap<>();
    
    while (n-- > 0)
      {
	int m = sc.nextInt ();
	int arr[] = new int[m];
	int j = 0;


	for (int i = 0 ; i < arr.length; i++)
	  {
	    arr[i] = sc.nextInt();
	  }
	  
    for(int num : arr)
    {
        if(map.containsKey(num))
        map.put(num,map.get(num)+1);
        else
        map.put(num,1);
        
        if(Collections.max(map.values())>1)
        {
         j = num ;
         break;
        }
    }
    
    for(int i = 0 ;i<arr.length;i++)
    {
        if(arr[i]!=j)
        {
            ans = i+1;
            break;

        }
    }
	System.out.println (ans);
      }
  }

}

Test Case : 5 1 4 4 4 4

on any other compiler , it is giving answer as 1 but only CF submit its giving answer as 2 . Can someone help me !!!