Revision en1, by DavidVictor2004, 2017-12-30 15:59:35

Hello! i dont understand why i get this error. In custom test it is working fine at first test. Thanks

http://codeforces.net/contest/253/problem/A

/* package whatever; // don't place package name! */

import java.util.*; import java.lang.*; import java.io.*; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException;

/* Name of the class has to be "Main" only if the class is public. */ public class bbg { public static int result;

public static ArrayList [] graph;

public static int[]cats;

public static int vizitat[]; public static int x; //public static HashMap<String, Integer> map2;

public static void main (String[] args) throws java.lang.Exception

{

Scanner input=new Scanner(System.in);

HashMap<Integer, Integer> contor1= new HashMap<Integer, Integer>(); HashMap<Integer, Integer> contor2= new HashMap<Integer, Integer>();

HashMap<Integer, Integer> map= new HashMap<Integer, Integer>(); HashMap<String, Integer> curatare= new HashMap<String, Integer>(); HashMap<String, Integer> combinari= new HashMap<String, Integer>();

String nn=input.nextLine(); // System.out.println(nn);

int poz=nn.indexOf(" "); // System.out.println(poz);

int n=Integer.parseInt(nn.substring(0,nn.indexOf(" ")));

int m=Integer.parseInt(nn.substring(nn.indexOf(" ")+1));

//  System.out.println(n+" "+m);
    int min=Math.min(n,m);
    int max=Math.max(n,m);

    String ras="";


    for(int i=1;i<=min;i++) {ras+="B"; ras+="G";}

    for(int j=1;j<=max-min;j++)
    if(m>n) ras+="G";
    else ras+="B";

    System.out.println(ras);

}

    }

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English DavidVictor2004 2017-12-30 15:59:35 1831 Initial revision (published)