結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー piyoko_212
提出日時 2015-12-26 15:43:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 259 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 34,380 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-25 22:46:53
合計ジャッジ時間 1,194 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         int a;scanf("%d",&a);
      |               ~~~~~^~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<algorithm>
using namespace std;
int s[]={2,3,5,7,11,13};
int t[]={4,6,8,9,10,12};
int main(){
	int a;scanf("%d",&a);
	int ret=0;
	for(int i=0;i<6;i++)for(int j=0;j<6;j++)
		if(s[i]*t[j]==a)ret++;
	printf("%.15f\n",(double)ret/36);
}
0