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