結果
| 問題 |
No.820 Power of Two
|
| コンテスト | |
| ユーザー |
giru_yukiko
|
| 提出日時 | 2019-05-27 21:18:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 336 bytes |
| コンパイル時間 | 193 ms |
| コンパイル使用メモリ | 30,336 KB |
| 実行使用メモリ | 15,544 KB |
| 最終ジャッジ日時 | 2024-09-17 15:34:42 |
| 合計ジャッジ時間 | 6,528 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 9 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
4 | main(){
| ^~~~
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | fgets(buf,sizeof(buf),stdin);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#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);
}
giru_yukiko