fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.time.LocalTime;
  7. import java.time.temporal.ChronoUnit;
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void runProgram() {
  13. System.out.println("AZAZA!");
  14. }
  15. public static void main (String[] args) throws java.lang.Exception
  16. {
  17. LocalTime time = LocalTime.now();
  18. int seconds = time.getSecond();
  19. int minutesRem = time.getMinute() % 5;
  20. long offset = 0;
  21. if (seconds != 0 || minutesRem != 0) {
  22. offset = time.until(time.minusSeconds(Long.valueOf(seconds)).plusMinutes(Long.valueOf(5 - minutesRem)), ChronoUnit.MILLIS);
  23. }
  24. if (offset == 0) {
  25. runProgram();
  26. } else {
  27. new Timer().schedule(new TimerTask() {
  28. @Override
  29. public void run() {
  30. runProgram();
  31. }
  32. }, offset);
  33. }
  34. }
  35. }
Time limit exceeded #stdin #stdout 5s 2448384KB
stdin
Standard input is empty
stdout
Standard output is empty