結果

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

ソースコード

diff #

#include <cstdio>
int main(){
    const int A[6]={2,3,5,7,11,13};
    const int B[6]={4,6,8,9,10,12};
    int K;
    double cnt[200+1]={0};
    for(int i=0;i<6;i++){
        for(int k=0;k<6;k++){
            cnt[A[i]*B[k]]++;
        }
    }
    scanf("%d",&K);
    printf("%.13lf\n",cnt[K]/36);
    return 0;
}
0