結果
問題 |
No.211 素数サイコロと合成数サイコロ (1)
|
ユーザー |
![]() |
提出日時 | 2015-08-23 16:56:11 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 414 bytes |
コンパイル時間 | 1,225 ms |
コンパイル使用メモリ | 157,532 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-18 12:52:05 |
合計ジャッジ時間 | 1,908 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:18:31: warning: ‘%.11451411919191919191919191...’ directive precision out of range [-Wformat-overflow=] 18 | printf("%.1145141191919191919191919191919911111111111111111111Lf\n", (long double)res / 36.0); | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:18:11: warning: ‘%.11451411919191919191919191...’ directive writing 3 or more bytes into a region of size 9223372036854775807 [-Wformat-overflow=] 18 | printf("%.1145141191919191919191919191919911111111111111111111Lf\n", (long double)res / 36.0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cpp:18:10: note: assuming directive output of 9223372036854775809 bytes 18 | printf("%.1145141191919191919191919191919911111111111111111111Lf\n", (long double)res / 36.0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/stdio.h:894, from /usr/include/c++/11/cstdio:42, from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:46, from main.cpp:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:112:23: note: ‘__printf_chk’ output 5 or more bytes (assuming 9223372036854775811) 112 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ()); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; int pdice[6] = {2, 3, 5, 7, 11, 13}; int cdice[6] = {4, 6, 8, 9, 10, 12}; int K; int main(){ cin >> K; int res = 0; for (int i = 0; i < 6; i++){ for (int j = 0; j < 6; j++){ int num = pdice[i] * cdice[j]; if (num == K){ res++; } } } printf("%.1145141191919191919191919191919911111111111111111111Lf\n", (long double)res / 36.0); }