結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー togaerror
提出日時 2015-05-29 12:07:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 376 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 31,232 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 10:39:31
合計ジャッジ時間 798 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%d %d", &p, &c);
      |         ~~~~~^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main( ) {
	int sai1[6] = {2, 3, 5, 7, 11, 13};
	int sai2[6] = {4, 6, 8, 9, 10, 12};
	int p, c;
	double xsum = 0, ysum = 0;
	double res;

	scanf("%d %d", &p, &c);
	for(int i = 0; i < 6; i++) {
		xsum += sai1[i];
		ysum += sai2[i];
	}
	xsum /= 6;
	ysum /= 6;
	res = pow(xsum, p) * pow(ysum, c);
	
	printf("%.10f\n", res);

	return 0;
}
0