結果

問題 No.642 Two Operations No.1
ユーザー bal4ubal4u
提出日時 2019-04-14 07:40:21
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 871 ms
コンパイル使用メモリ 26,936 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 10:34:52
合計ジャッジ時間 1,722 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

// yukicoder: No.642 Two Operations No.1
// 2019.4.14 bal4u

#include <stdio.h>

int main()
{
	int x, N, ans;
	
	scanf("%d", &N);
	ans = 0, x = 1;
	while (x < N) x <<= 1, ans++;
	ans += x - N;
	printf("%d\n", ans);
	return 0;
}
0