import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); BigInteger s=new BigInteger(sc.next()); BigInteger one=new BigInteger("1"); BigInteger two=new BigInteger("2"); BigInteger sum= new BigInteger("0"); BigInteger cnt= new BigInteger("0"); for (int i = 1; i <=n; i++) { cnt=cnt.multiply(two).add(one); sum=sum.add(cnt); } System.out.println( s.add(new BigInteger(sum+"")).divide( new BigInteger((two.pow(n+1).subtract(one)) +""))); } }
0.0分
1 人评分
DNA (C++代码)浏览:651 |
C语言程序设计教程(第三版)课后习题10.7 (C++代码)(都说了scanf和gets一般不要混着用)浏览:1127 |
C语言程序设计教程(第三版)课后习题10.1 (C语言代码)浏览:1449 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码) 用函数传参的方法浏览:4084 |
震宇大神的杀毒软件 (C语言代码)浏览:1243 |
简单编码 (C++代码)浏览:678 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:678 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:669 |
陈教主的三角形 (C语言代码)浏览:1143 |
最好的,浏览:564 |