結果
| 問題 |
No.354 メルセンヌ素数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-08-14 16:35:52 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 269 bytes |
| コンパイル時間 | 670 ms |
| コンパイル使用メモリ | 20,352 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-07 16:46:38 |
| 合計ジャッジ時間 | 1,357 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 13 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:9: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | fscanf(stdin, "%lu", &inputNum);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#define BIT 2
int main(void)
{
unsigned long inputNum;
fscanf(stdin, "%lu", &inputNum);
unsigned long countBinaryBit = 0;
while (inputNum) {
inputNum /= BIT;
countBinaryBit++;
}
fprintf(stdout, "%lu\n", countBinaryBit);
return 0;
}