結果

問題 No.820 Power of Two
ユーザー giru_yukikogiru_yukiko
提出日時 2019-05-27 21:19:17
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 1,881 ms
コンパイル使用メモリ 29,288 KB
実行使用メモリ 10,664 KB
最終ジャッジ日時 2023-10-17 18:18:18
合計ジャッジ時間 6,710 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:4:1: warning: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>

main(){
	int index1,index2;
	int number=1;
	int ans=0;
	long long cmp[2];
	char buf[100];

	fgets(buf,sizeof(buf),stdin);
	sscanf(buf,"%d %d",&index1,&index2);

	cmp[0]=pow(2,index1);
	cmp[1]=number*pow(2,index2);
	while(cmp[1]<=cmp[0]){
		number++;
		ans++;
	}

	printf("%x\n",ans);
	return(0);
}
0