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.  
  7. public class Main {
  8. static long inf = 1000000007;
  9.  
  10. static int count_ones (int n)
  11. {
  12. final int NIBBLE_LOOKUP [] =
  13. {
  14. 0, 1, 1, 2, 1, 2, 2, 3,
  15. 1, 2, 2, 3, 2, 3, 3, 4
  16. };
  17.  
  18.  
  19. return NIBBLE_LOOKUP[n & 0x0F] + NIBBLE_LOOKUP[n >> 4];
  20. }
  21.  
  22. public static void main(String[] args) {
  23. Scanner sc = new Scanner(System.in);
  24. String str = sc.next();
  25.  
  26. long ans = 1;
  27.  
  28. for (int i = 0; i < str.length(); i++) {
  29. char c = str.charAt(i);
  30. int nr;
  31.  
  32. if ( c >= '0' && c <= '9' )
  33. nr = c - '0';
  34. else if ( c >= 'a' && c <= 'z' )
  35. nr = c - 'a' + 36;
  36. else if ( c >= 'A' && c <= 'Z' )
  37. nr = c - 'A' + 10;
  38. else if (c == '_')
  39. nr = 63;
  40. else
  41. nr = 62;
  42.  
  43. nr = new Double(Math.pow(2, 5 - count_ones(nr))).intValue() * 2 + 1;
  44. ans %= inf;
  45. ans = ans * nr;
  46. }
  47.  
  48. System.out.println(ans);
  49. }
  50. }
Runtime error #stdin #stdout #stderr 0.14s 321344KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.util.NoSuchElementException
	at java.util.Scanner.throwFor(Scanner.java:862)
	at java.util.Scanner.next(Scanner.java:1371)
	at Main.main(Main.java:24)