結果

問題 No.820 Power of Two
ユーザー john
提出日時 2019-06-30 21:58:35
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 302 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 30,336 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 21:25:38
合計ジャッジ時間 3,844 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<math.h>
int n,k;
int main() {
	int i;
	int count = 0;
	int powers_n;
	int powers_k;
	scanf("%d %d", &n, &k);
	powers_n = pow(2,n);
	powers_k = pow(2,k);
	for(i = 1;i <= powers_n;i++) {
		if(powers_k * i <= powers_n) {
			count++;
		}
	}
	printf("%d\n",count);
	return (0);
}
0