fork download
  1. def parse(inFile):
  2. return inFile.getInt()
  3.  
  4. def primes(N):
  5. P = range(N+1)
  6. p = 2
  7. while (p * p <= N):
  8. if P[p]:
  9. P[p*p::p] = [0] * (1 + (N / p) - p)
  10. p += 1
  11. P[1] = 0
  12. return [p for p in P if p]
  13.  
  14. P = primes(10 ** 6)
  15. pows = [1]
  16. for p in P:
  17. print p
  18. k = p * p
  19. while k <= 10 ** 12:
  20. pows.append(k)
  21. k = k * p
  22. pows.sort()
  23.  
  24. def solve(N):
  25. if (N == 1): return 0
  26. return len([z for z in pows if z <= N])
  27.  
  28. if __name__ == "__main__":
  29. from GCJ import GCJ
  30. GCJ(parse, solve, "/Users/lpebody/gcj/2011_round2/", "c").run()
  31.  
  32.  
  33.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1: error: ‘def’ does not name a type
stdout
Standard output is empty