結果
問題 | No.589 Counting Even |
ユーザー |
|
提出日時 | 2017-11-03 23:06:19 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 421 bytes |
コンパイル時間 | 720 ms |
コンパイル使用メモリ | 112,428 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 22:18:44 |
合計ジャッジ時間 | 1,687 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 13 |
ソースコード
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 = 1;for (long i = 0; i <= bsr(N); ++i) {if (N & (1 << i)) ans *= 2;}writeln(N - ans + 1);}