Trying to execute a java program in online ide(https://www.jdoodle.com/online-java-compiler/) input through stdin with a 10000 length array of long type using binary search ,quick sort and got rpc error: code = 2 desc = oci runtime error: exec failed: argument list too long. I looked for this error but not found any answer related to java.
// package comcoding;
/* IMPORTANT: Multiple classes and nested static classes are supported */
/*
* uncomment this if you want to read input.
//imports for BufferedReader
import java.io.BufferedReader;
import java.io.InputStreamReader;
*/
//import for Scanner and other utility classes
import java.util.*;
// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
public class TestClass {
public static void main(String args[] ) throws Exception {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt(),m=sc.nextInt(),q=sc.nextInt();
Long z=Long.valueOf(0),l1=Long.valueOf(0),r1=Long.valueOf(0),l2=Long.valueOf(0),r2=Long.valueOf(0),c=Long.valueOf(0);
char ch='a';
Long x[]=new Long[n];
Long y[]=new Long[m];
for(int i=0;i<n;i++)
x[i]=sc.nextLong();
TestClass.quicksort(x,0,n-1);
// for(int i=0;i<n;i++)
// System.out.print(i+" xi "+x[i]+" ; ");
// System.out.println();
for(int i=0;i<m;i++)
y[i]=sc.nextLong();
TestClass.quicksort(y,0,m-1);
// for(int i=0;i<m;i++)
// System.out.print(i+" yi "+y[i]+" ; ");
// System.out.println();
for(int i=0;i<q;i++){
// ArrayList<Integer> xx=new ArrayList<Integer>();
//doubt if previous loop data exists in it
z=sc.nextLong();
ch=sc.next().charAt(0);;
if(ch=='A'){
// System.out.println("entered a");
l1=sc.nextLong();
r1=sc.nextLong();
// System.out.println("l1 "+l1+" r1 "+r1);
// for(int j=0;j<n;j++){
// if((x[j]>=l1)&&(x[j]<=r1)){
// xx.add(x[j]);
// // System.out.print("x1 "+x[j]+" ");
// }
// }
int lo=TestClass.binarysearch(x,l1,true),up=TestClass.binarysearch(x,r1,false);
// System.out.println("l000000ooooo "+lo+" upppppppppppppp "+up);
int s=0,t=0;
for(int k=lo;k<=up;k++){
for(int f=0;f<m;f++){
// System.out.println("lo");
if((y[f]+x[k])<=z){
c++;
}
}
}
}
if(ch=='B'){
// System.out.println("entered b");
l2=sc.nextLong();
r2=sc.nextLong();
// System.out.println("l1 "+l2+" r1 "+r2);
// for(int j=0;j<n;j++){
// if((x[j]>=l1)&&(x[j]<=r1)){
// xx.add(x[j]);
// // System.out.print("x1 "+x[j]+" ");
// }
// }
int lo=TestClass.binarysearch(y,l2,true),up=TestClass.binarysearch(y,r2,false);
// System.out.println("l000000ooooo "+lo+" upppppppppppppp "+up);
int s=0,t=0;
for(int k=lo;k<=up;k++){
for(int f=0;f<n;f++){
// System.out.println("lo");
if((x[f]+y[k])<=z){
c++;
}
}
}
}
if(ch=='C'){
// System.out.println("entered0 c");
l1=sc.nextLong();
r1=sc.nextLong();
l2=sc.nextLong();
r2=sc.nextLong();
// System.out.println("l1 "+l1+" r1 "+r1+" l2 "+l2+" r2 "+r2);
// for(int j=0;j<n;j++){
// if((x[j]>=l1)&&(x[j]<=r1)){
// xx.add(x[j]);
// // System.out.print("x1 "+x[j]+" ");
// }
// }
int low=TestClass.binarysearch(x,l1,true),upp=TestClass.binarysearch(x,r1,false),lo=TestClass.binarysearch(y,l2,true),up=TestClass.binarysearch(y,r2,false);
// System.out.println("l000000oooooww "+low+" uppppppppppppppeer "+upp+" l000000ooooo "+lo+" upppppppppppppp "+up);
// System.out.println("---------------------------------low -- "+(low!=0)+"--------------uppp " +(upp!=0)+"------------------ "+((low!=0)||(upp!=0))+" second finallll "+(((low!=0)||(upp!=0))&&((lo!=0)||(up!=0))) );
// System.out.println("ccccccccccc "+c);
int s=0,t=0;
if(((low!=0)||(upp!=0))&&((lo!=0)||(up!=0))){
for(int k=lo;k<=up;k++){
for(int f=low;f<=upp;f++){
// System.out.println("lo");
if((x[f]+y[k])<=z){
c++;
}
}
}}
}
// System.out.println("cccccccc-------"+c);
// if((i+1)==11){
// System.out.println("i "+(i+1)+" "+z+" "+ch+" "+l1+" "+r1+" "+l2+" "+r2);
// }
// System.out.println("i "+(i+1)+" c "+c+" ");
System.out.println(c);
c=Long.valueOf(0);
}
}
static int binarysearch(Long[] x,Long l1,boolean ch){
int l=0,u=x.length-1,m=0;
while(l<=u){
m=(l+u)/2;
if(x[m]<l1){
l=m+1;
}
else if(x[m]>l1){
u=m-1;
}else{
// System.out.println("hellllooooo "+a[m]);
return m;
}
}
if((ch)&&(x[m]<l1)){
return m+1;
}else if((!ch)&&(x[m]>l1)){
if((m-1)>0)
return m-1;
}
return m;
}
static void quicksort(Long[] x,int l,int h){
if(l<h){
int p=TestClass.partition(x,l,h);
TestClass.quicksort(x,l,p-1);
// System.out.println("l "+l+"h "+h+"----+++++++-------");
TestClass.quicksort(x,p+1,h);
}
}
static int partition(Long[] x,int l,int h){
int ll=l,hh=h;
Long y=Long.valueOf(0);
Long p=x[l];
l++;
// System.out.println("ll "+ll+"hh "+hh+"----------- p "+p);
while(l<h){
while((l<hh)&&(x[l]<p)){
l++;
}
// System.out.println("l- "+l+" h- "+h);
while((h>ll)&&(x[h]>p)){
h--;
}
// System.out.println("after l- "+l+" h- "+h);
if(l<h){
y=x[l];
x[l]=x[h];
x[h]=y;
// System.out.println("l<h al- "+x[l]+" xh- "+x[h]);
}
}
// System.out.println("exit while l- "+l+" h- "+h);
if((ll<hh)&&(x[ll]>x[h])){
y=x[h];
x[h]=x[ll];
x[ll]=y;
// System.out.println("end al- "+x[ll]+" ah- "+x[h]);
// System.out.println("l- "+l+" h- "+h);
}
// System.out.println();
// System.out.println(" ret l- "+l+" h- "+h);
// System.out.println("-------------------------------------------------------------------");
// 637544453401 C 3101614662 3287893408 266524764215 308526940985
return h;
}
}
**input 10000 length 2 arrays **
10000 10000 1 789874500501 325673087722 424799645961 619983971788 943992099904 184711650438 500309251406 809601765404 510633496820 74130413859 846798167606 233688781167 189645232427 609834491153 350313551635 735795297920 259779970990 541488679445 427725473739 734848163004 24540068126 428405180904 128352850775 682188252359 3754345071 965669722295 199701595716 309394724087 445432444775 495867539361 ...