大多是IO时间过长,网上找到一个快速IO模板,实测可以大幅降低IO时间。 让题目从TLE变成AC
import java.io.*;
import java.lang.*;
import java.util.*;
import java.math.*;
public class Main {
static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
static int nextInt() throws IOException {
in.nextToken();
return (int) in.nval;
}
static double nextDouble() throws IOException {
in.nextToken();
return in.nval;
}
static long nextLong() throws IOException {
in.nextToken();
return (long) in.nval;
}
static String next() throws IOException {
in.nextToken();
return in.sval;
}
public static void main(String[] args) throws IOException {
int a = nextInt();
out.print("接收:"+a);
out.flush(); //加这行代码,输出才会显示
}
}