結果
問題 |
No.680 作れる数
|
ユーザー |
![]() |
提出日時 | 2018-06-24 22:41:46 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 871 ms |
コンパイル使用メモリ | 124,672 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-13 01:15:13 |
合計ジャッジ時間 | 1,694 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
import std.stdio, std.conv, std.string, std.bigint; import std.math, std.random, std.datetime; import std.array, std.range, std.algorithm, std.container; string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; } void main(){ long n = read.to!long; long[] bs; for(long b = 1; b <= n; b *= 2, b += 1) bs ~= b; foreach_reverse(b; bs) if(n >= b) n -= b; if(n == 0) "YES".writeln; else "NO".writeln; }