fork download
  1.  
  2. import java.io.BufferedReader;
  3. import java.io.IOException;
  4. import java.io.InputStreamReader;
  5. import java.io.StreamTokenizer;
  6. import java.util.ArrayList;
  7. import java.util.Collections;
  8. import java.util.Iterator;
  9. import java.util.TreeSet;
  10. import java.lang.Integer;
  11.  
  12. public class multithreading_kp_java {
  13.  
  14.  
  15. static int nextInt() {
  16. try {
  17. st.nextToken();
  18. return (int) st.nval;
  19. } catch (IOException ex) {
  20. return 0;
  21. }
  22. }
  23.  
  24. public static void main(String[] args) {
  25. int n = nextInt();
  26. ArrayList<Integer> l= new ArrayList<Integer>();
  27. for (int i = 0; i < n; i++) {
  28. l.add(nextInt());
  29. }
  30. int ans = n - 1;
  31. for (int i = n - 1; i > 0; i--) {
  32. if (l.get(i) < l.get(i - 1)) {
  33. break;
  34. }
  35. ans--;
  36. }
  37. System.out.println(ans);
  38. }
  39. }
  40.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: class multithreading_kp_java is public, should be declared in a file named multithreading_kp_java.java
public class multithreading_kp_java {
       ^
1 error
stdout
Standard output is empty