java fast io codeforces

Solutions on MaxInterview for java fast io codeforces by the best coders in the world

showing results for - "java fast io codeforces"
Marlene
15 Jan 2019
1import java.io.*;
2import java.util.*;
3 
4 
5public class Main{
6   public static void main(String[] args) {
7      MyScanner sc = new MyScanner();
8      out = new PrintWriter(new BufferedOutputStream(System.out));
9      
10      // Start writing your solution here. -------------------------------------
11   
12      /*
13      int n      = sc.nextInt();        // read input as integer
14      long k     = sc.nextLong();       // read input as long
15      double d   = sc.nextDouble();     // read input as double
16      String str = sc.next();           // read input as String
17      String s   = sc.nextLine();       // read whole line as String
18
19      int result = 3*n;
20      out.println(result);                    // print via PrintWriter
21      */
22
23      // Stop writing your solution here. -------------------------------------
24      out.close();
25   }
26
27     
28
29   //-----------PrintWriter for faster output---------------------------------
30   public static PrintWriter out;
31      
32   //-----------MyScanner class for faster input----------
33   public static class MyScanner {
34      BufferedReader br;
35      StringTokenizer st;
36 
37      public MyScanner() {
38         br = new BufferedReader(new InputStreamReader(System.in));
39      }
40 
41      String next() {
42          while (st == null || !st.hasMoreElements()) {
43              try {
44                  st = new StringTokenizer(br.readLine());
45              } catch (IOException e) {
46                  e.printStackTrace();
47              }
48          }
49          return st.nextToken();
50      }
51 
52      int nextInt() {
53          return Integer.parseInt(next());
54      }
55 
56      long nextLong() {
57          return Long.parseLong(next());
58      }
59 
60      double nextDouble() {
61          return Double.parseDouble(next());
62      }
63 
64      String nextLine(){
65          String str = "";
66	  try {
67	     str = br.readLine();
68	  } catch (IOException e) {
69	     e.printStackTrace();
70	  }
71	  return str;
72      }
73
74   }
75   //--------------------------------------------------------
76}