fork download
  1. #include <stdio.h>
  2.  
  3. int foo(int n)
  4. {
  5. if (n < 30) return 1 << n;
  6. int re = (1 << 30) % 1000000007;
  7. for(int i=31; n>i; i++)
  8. {
  9. re <<= 1;
  10. if (re > 1000000007) re -= 1000000007;
  11. }
  12. return re;
  13. }
  14.  
  15.  
  16. int main()
  17. {
  18. int n;
  19. scanf("%d",&n);
  20. printf("%d",foo(n));
  21. return 0;
  22. }
Success #stdin #stdout 0s 4500KB
stdin
35
stdout
179869065