結果

問題 No.1033 乱数サイ
ユーザー aki1tig0daaki1tig0da
提出日時 2020-05-04 05:15:24
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 417 ms
コンパイル使用メモリ 28,036 KB
実行使用メモリ 8,756 KB
最終ジャッジ日時 2023-09-05 19:17:51
合計ジャッジ時間 6,448 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
8,756 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 4 ms
4,376 KB
testcase_12 AC 47 ms
4,376 KB
testcase_13 AC 124 ms
4,380 KB
testcase_14 AC 1,644 ms
4,380 KB
testcase_15 WA -
testcase_16 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void){
    int n, k;
    double ans = 0.0;
    scanf("%d%d", &n, &k);
    int cnt1 = n*k+k, cnt2 = k;
    double deno = 1.0/cnt1;
    while(cnt1!=0){
        while(cnt2!=0){
            ans += n*deno;
            cnt2--;
        }
        cnt2 = k;
        n--;
        cnt1 -= cnt2;
    }
    printf("%f\n", ans);
    return 0;
}
0