結果
問題 |
No.47 ポケットを叩くとビスケットが2倍
|
ユーザー |
|
提出日時 | 2015-08-16 04:29:08 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 390 bytes |
コンパイル時間 | 204 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 09:48:29 |
合計ジャッジ時間 | 872 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d",&N); | ^~~~~~~~~~~~~~
ソースコード
#include<stdio.h> void main(void){ unsigned int N; scanf("%d",&N); N--; N=N|(N>>1); N=N|(N>>2); N=N|(N>>4); N=N|(N>>8); N=N|(N>>16); N=(N&0x55555555)+(N>>1&0x55555555); N=(N&0x33333333)+(N>>2&0x33333333); N=(N&0x0f0f0f0f)+(N>>4&0x0f0f0f0f); N=(N&0x00ff00ff)+(N>>8&0x00ff00ff); N=(N&0x0000ffff)+(N>>16&0x0000ffff); printf("%d\n",N); }