fork download
  1. using System;
  2. using System.Runtime.InteropServices;
  3.  
  4. class CodeIQ2812{
  5. [DllImport("msvcrt",CallingConvention=CallingConvention.Cdecl)]static extern int __popcountdi2(long n);
  6. [DllImport("msvcrt",CallingConvention=CallingConvention.Cdecl)]static extern int __sched_cpucount(int n, long[] a);
  7.  
  8. static int popcount(long n){
  9. //return __popcountdi2(n);
  10. return __sched_cpucount(8,new long[]{n});
  11. //return n==0 ? 0 : popcount(n/2)+(int)(n%2);
  12. }
  13. static void Main(){
  14. int n=int.Parse(Console.ReadLine());
  15. Console.WriteLine(1<<popcount(n));
  16. }
  17. }
Success #stdin #stdout 0.05s 23968KB
stdin
98765432
stdout
8192