結果

問題 No.211 素数サイコロと合成数サイコロ (1)
ユーザー yuma220284
提出日時 2019-04-03 13:35:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 309 bytes
コンパイル時間 2,406 ms
コンパイル使用メモリ 166,912 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-18 00:51:12
合計ジャッジ時間 2,705 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:20: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘std::map<int, long double>::mapped_type’ {aka ‘long double’} [-Wformat=]
   13 |         printf("%12f", mp[K]);
      |                 ~~~^
      |                    |
      |                    double
      |                 %12Lf

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

int main() {
	int P[6] = { 2, 3, 5, 7, 11, 13 }, C[6] = { 4, 6, 8, 9, 10, 12 }, K;
	map<int, long double> mp;
	cin >> K;
	for (int i = 0; i < 6; i++) {
		for (int j = 0; j < 6; j++) {
			mp[P[i] * C[j]] += 0.02777777777777777777;
		}
	}
	printf("%12f", mp[K]);
}
0