結果
| 問題 |
No.381 名声値を稼ごう Extra
|
| コンテスト | |
| ユーザー |
mits58
|
| 提出日時 | 2016-07-23 01:08:43 |
| 言語 | Java (openjdk 23) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 495 bytes |
| コンパイル時間 | 4,039 ms |
| コンパイル使用メモリ | 74,796 KB |
| 実行使用メモリ | 68,456 KB |
| 最終ジャッジ日時 | 2024-11-06 14:10:28 |
| 合計ジャッジ時間 | 12,599 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 TLE * 1 |
ソースコード
import java.math.BigInteger;
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
BigInteger n=sc.nextBigInteger();
BigInteger sum=n.divide(BigInteger.valueOf(2));
BigInteger max=n.max(n); n=n.divide(BigInteger.valueOf(2));
while(n.compareTo(BigInteger.ZERO)==1){
n=n.divide(BigInteger.valueOf(2));
sum=sum.add(n);
}
System.out.println(max.subtract(sum).toString());
}
}
}
mits58