結果
問題 |
No.378 名声値を稼ごう
|
ユーザー |
![]() |
提出日時 | 2017-05-04 07:10:13 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 53 ms / 2,000 ms |
コード長 | 616 bytes |
コンパイル時間 | 1,996 ms |
コンパイル使用メモリ | 74,500 KB |
実行使用メモリ | 37,108 KB |
最終ジャッジ日時 | 2024-06-30 01:12:00 |
合計ジャッジ時間 | 2,763 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); long N = Long.parseLong(reader.readLine()); System.out.println(N*2 - calculateReputation(N)); } private static long calculateReputation(long n) { long reputation = 0; while (n != 0) { reputation += n; n = n / 2; } return reputation; } }