DavidVictor2004's blog

By DavidVictor2004, history, 19 months ago, In English

Hello all, I get the error exit code 1 for the following test. Can you help me understanding why? Thanks in advance! https://codeforces.com/contest/1547/submission/126455872



while k > 0: y=1 stringul=input() if y==0: print("NO") else:
pozitia=stringul.find("a", 0, len(stringul)) if pozitia>-1: dreapta=pozitia stanga=pozitia else: y=0 for i in range(1, len(stringul)): pozitia=stringul.find(alfabet[i], 0, len(stringul)) dif_d=pozitia-dreapta dif_s=stanga-pozitia

if dif_d==1 and pozitia>-1: dreapta=pozitia

elif dif_s==1 and pozitia>-1: stanga=pozitia

else: y=0 i=len(stringul)

if y==1: print("YES") else: print("NO") k=k-1

Full text and comments »

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

By DavidVictor2004, history, 5 years ago, In English


I'm stuck at test 20, anyone knows why it's impossible to see test cases or other people submissions to this problem? Thanks,

Full text and comments »

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

By DavidVictor2004, history, 5 years ago, In English

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


/* 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";




Full text and comments »

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