File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -53,3 +53,45 @@ private static int getPreviousPowerOfTwo(int size)
53
53
}
54
54
55
55
}
56
+
57
+ class MyScanner {
58
+ BufferedReader br ;
59
+ StringTokenizer st ;
60
+
61
+ public MyScanner () {
62
+ br = new BufferedReader (new InputStreamReader (System .in ));
63
+ }
64
+
65
+ String next () {
66
+ while (st == null || !st .hasMoreElements ()) {
67
+ try {
68
+ st = new StringTokenizer (br .readLine ());
69
+ } catch (IOException e ) {
70
+ e .printStackTrace ();
71
+ }
72
+ }
73
+ return st .nextToken ();
74
+ }
75
+
76
+ int nextInt () {
77
+ return Integer .parseInt (next ());
78
+ }
79
+
80
+ long nextLong () {
81
+ return Long .parseLong (next ());
82
+ }
83
+
84
+ double nextDouble () {
85
+ return Double .parseDouble (next ());
86
+ }
87
+
88
+ String nextLine () {
89
+ String str = "" ;
90
+ try {
91
+ str = br .readLine ();
92
+ } catch (IOException e ) {
93
+ e .printStackTrace ();
94
+ }
95
+ return str ;
96
+ }
97
+ }
You can’t perform that action at this time.
0 commit comments