├── Main.java └── README.md /Main.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.io.*; 3 | 4 | public class Main{ 5 | static class FastReader{ 6 | BufferedReader br; 7 | StringTokenizer st; 8 | public FastReader(){ 9 | br=new BufferedReader(new InputStreamReader(System.in)); 10 | } 11 | String next(){ 12 | while(st==null || !st.hasMoreTokens()){ 13 | try { 14 | st=new StringTokenizer(br.readLine()); 15 | } catch (IOException e) { 16 | e.printStackTrace(); 17 | } 18 | } 19 | return st.nextToken(); 20 | } 21 | int nextInt(){ 22 | return Integer.parseInt(next()); 23 | } 24 | long nextLong(){ 25 | return Long.parseLong(next()); 26 | } 27 | double nextDouble(){ 28 | return Double.parseDouble(next()); 29 | } 30 | String nextLine(){ 31 | String str=""; 32 | try { 33 | str=br.readLine().trim(); 34 | } catch (Exception e) { 35 | e.printStackTrace(); 36 | } 37 | return str; 38 | } 39 | } 40 | static class FastWriter { 41 | private final BufferedWriter bw; 42 | 43 | public FastWriter() { 44 | this.bw = new BufferedWriter(new OutputStreamWriter(System.out)); 45 | } 46 | 47 | public void print(Object object) throws IOException { 48 | bw.append("" + object); 49 | } 50 | 51 | public void println(Object object) throws IOException { 52 | print(object); 53 | bw.append("\n"); 54 | } 55 | 56 | public void close() throws IOException { 57 | bw.close(); 58 | } 59 | } 60 | public static void main(String[] args) { 61 | try { 62 | FastReader in=new FastReader(); 63 | FastWriter out = new FastWriter(); 64 | int testCases=in.nextInt(); 65 | while(testCases-- > 0){ 66 | // write code here 67 | } 68 | out.close(); 69 | } catch (Exception e) { 70 | return; 71 | } 72 | } 73 | } 74 | 75 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # 🔥 fast-io-java 3 | A `JAVA` template for faster I/O times. 4 | 5 | ## How to use ? 6 | Copy this template in your local system and write your code using this template to write CP friendly codes. 7 | 8 | ## Accepted By 9 | 10 | 11 | 12 | ## Template 13 | 14 | ```java 15 | import java.util.*; 16 | import java.io.*; 17 | 18 | public class Main{ 19 | static class FastReader{ 20 | BufferedReader br; 21 | StringTokenizer st; 22 | public FastReader(){ 23 | br=new BufferedReader(new InputStreamReader(System.in)); 24 | } 25 | String next(){ 26 | while(st==null || !st.hasMoreTokens()){ 27 | try { 28 | st=new StringTokenizer(br.readLine()); 29 | } catch (IOException e) { 30 | e.printStackTrace(); 31 | } 32 | } 33 | return st.nextToken(); 34 | } 35 | int nextInt(){ 36 | return Integer.parseInt(next()); 37 | } 38 | long nextLong(){ 39 | return Long.parseLong(next()); 40 | } 41 | double nextDouble(){ 42 | return Double.parseDouble(next()); 43 | } 44 | String nextLine(){ 45 | String str=""; 46 | try { 47 | str=br.readLine().trim(); 48 | } catch (Exception e) { 49 | e.printStackTrace(); 50 | } 51 | return str; 52 | } 53 | } 54 | static class FastWriter { 55 | private final BufferedWriter bw; 56 | 57 | public FastWriter() { 58 | this.bw = new BufferedWriter(new OutputStreamWriter(System.out)); 59 | } 60 | 61 | public void print(Object object) throws IOException { 62 | bw.append("" + object); 63 | } 64 | 65 | public void println(Object object) throws IOException { 66 | print(object); 67 | bw.append("\n"); 68 | } 69 | 70 | public void close() throws IOException { 71 | bw.close(); 72 | } 73 | } 74 | public static void main(String[] args) { 75 | try { 76 | FastReader in=new FastReader(); 77 | FastWriter out = new FastWriter(); 78 | int testCases=in.nextInt(); 79 | while(testCases-- > 0){ 80 | // write code here 81 | } 82 | out.close(); 83 | } catch (Exception e) { 84 | return; 85 | } 86 | } 87 | } 88 | ``` 89 | 90 | ## Action Items 91 | Customize this template according to your own coding style to get the best out of it. 92 | --------------------------------------------------------------------------------