close

import java.util.Scanner;
import java.math.BigInteger;
import java.io.FileReader;
import java.io.IOException;
public class UVa10254 {
  public static void main(String[] args)throws IOException {
    FileReader fr = new FileReader("inputFile.in");
    Scanner input = new Scanner(fr);
    while (input.hasNextInt()) {
      BigInteger m = new BigInteger("2");
      BigInteger now  = new BigInteger("1");
      int c = 2;
      int no = input.nextInt() - 1;
      int i = 1;
      while (i <= no) {
        for (int j = 0; j < c; j++) {
          if (i > no)
            break;
          now = now.add(m);
          i++;
        }
        m = m.multiply(new BigInteger("2"));
        c++;
      }
      System.out.println(now);
    }
  }
}

 

arrow
arrow
    文章標籤
    UVa JAVA code
    全站熱搜
    創作者介紹
    創作者 蒼雨 的頭像
    蒼雨

    日常雜物間

    蒼雨 發表在 痞客邦 留言(0) 人氣()