結果

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

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <queue>
#include <string>
#include <functional>
#include <iostream>


using namespace std;
 
//namaega184 
 
int main(){
	int k;scanf("%d",&k); 
	int a[10]={2,3,5,7,11,13},b[10]={4,6,8,9,10,12};
	int c[200]={};
	for(int i=0;i<6;i++)for(int j=0;j<6;j++)c[a[i]*b[j]]++;
	printf("%.13f\n",(double)c[k]/36 );  
	return 0; 
}
0