結果

問題 No.589 Counting Even
ユーザー nebukuro09
提出日時 2017-11-03 23:07:05
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 892 ms
コンパイル使用メモリ 114,740 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 22:18:51
合計ジャッジ時間 1,624 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop;

void main() {
    auto N = readln.chomp.to!long;

    if (N <= 1) {
        writeln(0);
        return;
    }

    long ans = 1L << N.popcnt;
    writeln(N - ans + 1);
}
0