NYOJ 527 AC_mm玩dota
AC_mm玩dota
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input=new Scanner(System.in); int str[]=new int[60]; str[0]=1; str[1]=1; for(int i=2;i<59;i++){ str[i]=(str[i-1]+str[i-2])%1314520; } while(input.hasNext()){ int n=input.nextInt(); int a=0,b=0; while(n!=0){ if(n%2==0) b++; else a++; n/=2; } int sum=a*b; System.out.println(str[sum]); } } }