fork download
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class Main {
  5. public static void main(String[] args) {
  6. System.out.println("This is Fast Input Reader");
  7. }
  8.  
  9. /*
  10.   * Don't see below
  11.   */
  12. static Reader sc = new Reader();
  13. static StringBuilder sb = new StringBuilder();
  14. static Random rd = new Random();
  15.  
  16. static class Reader {
  17. private int BUFFER_SIZE = 1 << 16;
  18. private byte[] buffer = new byte[BUFFER_SIZE];
  19. private int bufferPointer = 0, bytesRead = 0;
  20. private InputStream rd;
  21.  
  22. public Reader() {
  23. this.rd = System.in;
  24. }
  25.  
  26. public Reader(String nameFile) {
  27. try {
  28. this.rd = new FileInputStream(nameFile);
  29. } catch (FileNotFoundException e) {
  30. e.printStackTrace();
  31. }
  32. }
  33.  
  34. private byte read() {
  35. if (bufferPointer == bytesRead) {
  36. bufferPointer = 0;
  37. try {
  38. bytesRead = rd.read(buffer, bufferPointer, BUFFER_SIZE);
  39. } catch (IOException e) {
  40. e.printStackTrace();
  41. }
  42. if (bytesRead == -1) {
  43. return -1;
  44. }
  45. }
  46. return buffer[bufferPointer++];
  47. }
  48.  
  49. public int nextInt() {
  50. int number = 0;
  51. int c = read();
  52. while (c <= ' ') {
  53. c = read();
  54. }
  55. boolean negative = (c == '-');
  56. if (negative) {
  57. c = read();
  58. }
  59. do {
  60. number = number * 10 + (c - '0');
  61. c = read();
  62. } while (c >= '0' && c <= '9');
  63. return negative ? -number : number;
  64. }
  65.  
  66. public long nextLong() {
  67. long number = 0L;
  68. int c = read();
  69. while (c <= ' ') {
  70. c = read();
  71. }
  72. boolean negative = (c == '-');
  73. if (negative) {
  74. c = read();
  75. }
  76. do {
  77. number = number * 10 + (c - '0');
  78. c = read();
  79. } while (c >= '0' && c <= '9');
  80. return negative ? -number : number;
  81. }
  82.  
  83. public String next() {
  84. int c = read();
  85. while (c <= ' ') {
  86. c = read();
  87. }
  88. StringBuilder t = new StringBuilder();
  89. do {
  90. t.append((char) c);
  91. c = read();
  92. } while (c > ' ');
  93. return t.toString();
  94. }
  95.  
  96. public String nextLine() {
  97. int c = read();
  98. while (c == '\n' || c == '\r') {
  99. c = read();
  100. }
  101. StringBuilder t = new StringBuilder();
  102. while (c != '\n' && c != '\r' && c != -1) {
  103. t.append((char) c);
  104. c = read();
  105. }
  106. return t.toString();
  107. }
  108.  
  109. public double nextDouble() {
  110. return Double.parseDouble(next());
  111. }
  112.  
  113. public char nextChar() {
  114. int c = read();
  115. while (c <= ' ') {
  116. c = read();
  117. }
  118. return (char) c;
  119. }
  120. }
  121. }
  122.  
Success #stdin #stdout 0.11s 52612KB
stdin
Standard input is empty
stdout
This is Fast Input Reader