結果

問題 No.680 作れる数
ユーザー bal4ubal4u
提出日時 2019-05-17 06:04:28
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 28,632 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 07:09:03
合計ジャッジ時間 1,024 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,348 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
4,348 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,348 KB
testcase_15 WA -
testcase_16 AC 1 ms
4,348 KB
testcase_17 WA -
testcase_18 AC 1 ms
4,348 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

// yukicoder: No.680 作れる数
// 2019.5.14 bal4u

#include <stdio.h>

int main()
{
	int i, N, s, t, ans;
	int min, max;
	
	scanf("%d", &N);
	min = max = 0, t = 1, ans = 0;
	while (min < N) {
		t <<= 1;
		min += t, max += (t << 1)-1;
		if (min <= N && N <= max) { ans = 1; break; }
	}
	puts(ans? "YES": "NO");
	return 0;
}
0