fork(2) 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.util.regex.*;
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. String o = "sssssssssssssssssssssssddddddddddddddddddddddddddd";
  13. for (int i = 0; i < 5; i++) {
  14. o += o;
  15. }
  16. o += "j";
  17.  
  18. System.out.println(o.length());
  19. System.out.println(o.matches("(.)(?>.*?((?!\\1).))(?>.*?((?!\\1|\\2).))(?>.*?((?!\\1|\\2|\\3).)).*"));
  20. System.out.println(o.matches("^\\w*(\\w)\\w*(?!\\w*\\1)(\\w)\\w*(?!\\w*\\1|\\w*\\2)(\\w)\\w*(?!\\w*\\1|\\w*\\2|\\w*\\3)(\\w)\\w*(?!\\w*\\1|\\w*\\2|\\w*\\3|\\w*\\4)\\w*$"));
  21. }
  22. }
Time limit exceeded #stdin #stdout 5s 320256KB
stdin
Standard input is empty
stdout
1601
false