結果
| 問題 |
No.354 メルセンヌ素数
|
| コンテスト | |
| ユーザー |
tsubaki961
|
| 提出日時 | 2016-05-03 01:12:00 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 195 bytes |
| コンパイル時間 | 390 ms |
| コンパイル使用メモリ | 22,144 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-05 02:46:33 |
| 合計ジャッジ時間 | 1,043 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 11 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%ld\n",&p);
| ^~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<math.h>
int main()
{
long a,binary=0,p;
scanf("%ld\n",&p);
a=pow(2,p)-1;
while(a>0){
binary += ( a % 2 );
a /= 2;
}
printf("%ld\n",binary);
return 0;
}
tsubaki961