結果
| 問題 |
No.47 ポケットを叩くとビスケットが2倍
|
| ユーザー |
|
| 提出日時 | 2018-03-28 22:45:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 195 bytes |
| コンパイル時間 | 365 ms |
| コンパイル使用メモリ | 30,848 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-25 13:21:57 |
| 合計ジャッジ時間 | 1,197 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d",&N);
| ~~~~~^~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
int main() {
int N;
scanf("%d",&N);
int n = log(N)/log(2);
if(N<2) printf("0\n");
else
printf("%d\n",log(N)/(n*log(2))==1?n:n+1);
return 0;
}