java中的非零退出代码,在codechef上提交时,否则可以正常工作
对于此代码,请在codechef上根据查询执行不同的操作 我得到非零退出代码,但它在我的机器上运行良好。这是空间问题还是其他问题?我使用java中的非零退出代码,在codechef上提交时,否则可以正常工作,java,Java,对于此代码,请在codechef上根据查询执行不同的操作 我得到非零退出代码,但它在我的机器上运行良好。这是空间问题还是其他问题?我使用StringTokenizer在fastcanaver类中进行快速输入 FastScanner sc = new FastScanner(); int n = sc.nextInt(); int q = sc.nextInt(); BigInteger[] arr = new BigInteger[n]; String val, s; for (int i =
StringTokenizer
在fastcanaver
类中进行快速输入
FastScanner sc = new FastScanner();
int n = sc.nextInt();
int q = sc.nextInt();
BigInteger[] arr = new BigInteger[n];
String val, s;
for (int i = 0; i < n; i++) {
arr[i] = new BigInteger("0");
}
BigInteger m = new BigInteger("1000000007");
for (int i = 0; i < n; i++) {
s = sc.nextToken();
arr[i] = new BigInteger(s);
}
while (q > 0) {
int c = sc.nextInt();
int st = sc.nextInt();
int en = sc.nextInt();
switch (c) {
case 1: {
val = sc.nextToken();
BigInteger v = new BigInteger(val);
for (int j = st - 1; j <= en - 1; j++) {
arr[j] = arr[j].add(v);
arr[j] = arr[j].mod(m);
}
break;
}
case 2: {
val = sc.nextToken();
BigInteger v = new BigInteger(val);
for (int j = st - 1; j <= en - 1; j++) {
arr[j] = arr[j].multiply(v);
arr[j] = arr[j].mod(m);
}
break;
}
case 3: {
val = sc.nextToken();
for (int j = st - 1; j <= en - 1; j++) {
arr[j] = new BigInteger("val");
}
break;
}
case 4: {
BigInteger sum = new BigInteger("0");
for (int j = st - 1; j <= en - 1; j++) {
sum = sum.add(arr[j]);
}
sum = sum.mod(m);
System.out.println(sum);
break;
}
}
q--;
}
FastScanner sc=新的FastScanner();
int n=sc.nextInt();
int q=sc.nextInt();
BigInteger[]arr=新的BigInteger[n];
字符串val,s;
对于(int i=0;i0){
int c=sc.nextInt();
int st=sc.nextInt();
int en=sc.nextInt();
开关(c){
案例1:{
val=sc.nextToken();
BigInteger v=新的BigInteger(val);
对于(int j=st-1;j,请给我们看准确的错误报告。我不知道,它只显示运行时错误(非零退出代码)