fork(1) download
  1. import java.util.Arrays;
  2.  
  3. public class FoxesOfTheRoundTable {
  4. public int[] minimalDifference(int[] h) {
  5. for(int i = 0; i < h.length; i++)
  6. h[i] = h[i] * 100 + i;
  7. Arrays.sort(h);
  8. int[] ret = new int[h.length];
  9. int p = 0;
  10. for(int i = 0; i < h.length; i++)
  11. if(i % 2 == 0)
  12. ret[p++] = h[i] % 100;
  13. for(int i = h.length-1; i >= 0; i--)
  14. if(i % 2 == 1)
  15. ret[p++] = h[i] % 100;
  16. return ret;
  17. }
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:3: error: class FoxesOfTheRoundTable is public, should be declared in a file named FoxesOfTheRoundTable.java
public class FoxesOfTheRoundTable {
       ^
1 error
stdout
Standard output is empty