Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class __Solution {
  5.  
  6. static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
  7.  
  8. public static void main(String[] args) {
  9. new __Solution().run();
  10. }
  11.  
  12. BufferedReader in;
  13. PrintWriter out;
  14. StringTokenizer tok;
  15.  
  16. void init() throws FileNotFoundException {
  17.  
  18.  
  19. if (false) {
  20. in = new BufferedReader(new InputStreamReader(System.in));
  21. out = new PrintWriter(System.out);
  22. } else {
  23. in = new BufferedReader(new FileReader("input.txt"));
  24. out = new PrintWriter("output.txt");
  25. }
  26.  
  27. tok = new StringTokenizer("");
  28. }
  29.  
  30. void run() {
  31. try {
  32. long timeStart = System.currentTimeMillis();
  33.  
  34. init();
  35. solve();
  36.  
  37. out.close();
  38.  
  39. long timeEnd = System.currentTimeMillis();
  40. System.err.println("Time = " + (timeEnd - timeStart));
  41. } catch (Exception e) {
  42. e.printStackTrace();
  43. System.exit(-1);
  44. }
  45. }
  46.  
  47. String readLine() throws IOException {
  48. return in.readLine();
  49. }
  50.  
  51.  
  52. String delimiter = " ";
  53.  
  54. String readString() throws IOException {
  55. while (!tok.hasMoreTokens()) {
  56. String nextLine = readLine();
  57. if (null == nextLine) return null;
  58.  
  59. tok = new StringTokenizer(nextLine);
  60. }
  61.  
  62. return tok.nextToken(delimiter);
  63. }
  64.  
  65. int readInt() throws IOException {
  66. return Integer.parseInt(readString());
  67. }
  68.  
  69. long readLong() throws IOException {
  70. return Long.parseLong(readString());
  71. }
  72.  
  73. public static int findMin(int[] array) {
  74. int min = array[0];
  75. for (int i = 0; i < array.length; i++) {
  76. if (array[i] < min) {
  77. min = array[i];
  78. }
  79. }
  80. return min;
  81. }
  82.  
  83. public static int findMax(int[] array) {
  84. int max = array[0];
  85. for (int i = 0; i < array.length; i++) {
  86. if (array[i] > max) {
  87. max = array[i];
  88. }
  89. }
  90. return max;
  91. }
  92.  
  93. void solve() throws IOException {
  94.  
  95. }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement