fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. static final long N = 100000L;
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. // your code goes here
  14. long c = 0L;
  15. for (long i = 0; i < N; i++)
  16. for (long k=i; k < N; k++)
  17. c++;
  18. System.out.printf("%16d%n", c);
  19. System.out.printf("%16d%n", N*N);
  20. }
  21. }
Success #stdin #stdout 3.51s 52624KB
stdin
Standard input is empty
stdout
      5000050000
     10000000000