G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 10th, 2020 113 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2. import java.io.*;
  3.  
  4. public class MainArray {
  5.     public static int ITERATION = 0;
  6.  
  7.     public static void main(String[] args) throws FileNotFoundException {
  8.         int n = 0;
  9.         Scanner in = new Scanner(new File("input.txt"));
  10.         PrintWriter out = new PrintWriter(new File("outputArray.txt"));
  11.         PrintWriter time = new PrintWriter(new File("timeArray.txt"));
  12.         PrintWriter iterationsArray = new PrintWriter(new File("iterationsArray.txt"));
  13.         PrintWriter sizesArray = new PrintWriter(new File("sizes.txt"));
  14.         while (in.hasNext()){
  15.             n = in.nextInt();
  16.             int[] a = new int[n];
  17.             MyArray array1 = new MyArray();
  18.             for (int i = 0; i <n ; i++) {
  19.                 a[i]=in.nextInt();
  20.             }
  21.             ITERATION = 0;
  22.             long before = System.nanoTime();
  23.             int[] result = array1.sortArray(a);
  24.             time.println(System.nanoTime() - before);
  25.             iterationsArray.println(ITERATION);
  26.             sizesArray.println(n);
  27.             out.println(n);
  28.             for (int i = 0; i < n; i++) {
  29.                 out.print(result[i] + " ");
  30.             }
  31.             out.println();
  32.         }
  33.         out.close();
  34.         iterationsArray.close();
  35.         time.close();
  36.         sizesArray.close();
  37.     }
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top