結果

問題 No.1319 最強とんがりコーン
ユーザー akakimidoriakakimidori
提出日時 2020-12-17 01:42:09
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 836 ms / 2,000 ms
コード長 849 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 31,684 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 10:23:22
合計ジャッジ時間 29,859 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 607 ms
4,348 KB
testcase_01 AC 635 ms
4,348 KB
testcase_02 AC 375 ms
4,348 KB
testcase_03 AC 203 ms
4,348 KB
testcase_04 AC 729 ms
4,348 KB
testcase_05 AC 650 ms
4,348 KB
testcase_06 AC 415 ms
4,348 KB
testcase_07 AC 238 ms
4,348 KB
testcase_08 AC 432 ms
4,348 KB
testcase_09 AC 713 ms
4,348 KB
testcase_10 AC 72 ms
4,348 KB
testcase_11 AC 278 ms
4,348 KB
testcase_12 AC 471 ms
4,348 KB
testcase_13 AC 300 ms
4,348 KB
testcase_14 AC 111 ms
4,348 KB
testcase_15 AC 323 ms
4,348 KB
testcase_16 AC 133 ms
4,348 KB
testcase_17 AC 831 ms
4,348 KB
testcase_18 AC 161 ms
4,348 KB
testcase_19 AC 836 ms
4,348 KB
testcase_20 AC 624 ms
4,348 KB
testcase_21 AC 642 ms
4,348 KB
testcase_22 AC 602 ms
4,348 KB
testcase_23 AC 625 ms
4,348 KB
testcase_24 AC 618 ms
4,348 KB
testcase_25 AC 641 ms
4,348 KB
testcase_26 AC 623 ms
4,348 KB
testcase_27 AC 618 ms
4,348 KB
testcase_28 AC 614 ms
4,348 KB
testcase_29 AC 614 ms
4,348 KB
testcase_30 AC 629 ms
4,348 KB
testcase_31 AC 627 ms
4,348 KB
testcase_32 AC 408 ms
4,348 KB
testcase_33 AC 833 ms
4,348 KB
testcase_34 AC 616 ms
4,348 KB
testcase_35 AC 639 ms
4,348 KB
testcase_36 AC 621 ms
4,348 KB
testcase_37 AC 637 ms
4,348 KB
testcase_38 AC 626 ms
4,348 KB
testcase_39 AC 715 ms
4,348 KB
testcase_40 AC 285 ms
4,348 KB
testcase_41 AC 67 ms
4,348 KB
testcase_42 AC 102 ms
4,348 KB
testcase_43 AC 72 ms
4,348 KB
testcase_44 AC 109 ms
4,348 KB
testcase_45 AC 53 ms
4,348 KB
testcase_46 AC 604 ms
4,348 KB
testcase_47 AC 82 ms
4,348 KB
testcase_48 AC 281 ms
4,348 KB
testcase_49 AC 88 ms
4,348 KB
testcase_50 AC 76 ms
4,348 KB
testcase_51 AC 58 ms
4,348 KB
testcase_52 AC 72 ms
4,348 KB
testcase_53 AC 45 ms
4,348 KB
testcase_54 AC 130 ms
4,348 KB
testcase_55 AC 104 ms
4,348 KB
testcase_56 AC 67 ms
4,348 KB
testcase_57 AC 47 ms
4,348 KB
testcase_58 AC 46 ms
4,348 KB
testcase_59 AC 42 ms
4,348 KB
testcase_60 AC 30 ms
4,348 KB
testcase_61 AC 30 ms
4,348 KB
testcase_62 AC 30 ms
4,348 KB
testcase_63 AC 30 ms
4,348 KB
testcase_64 AC 424 ms
4,348 KB
testcase_65 AC 422 ms
4,348 KB
testcase_66 AC 30 ms
4,348 KB
testcase_67 AC 604 ms
4,348 KB
testcase_68 AC 786 ms
4,348 KB
testcase_69 AC 600 ms
4,348 KB
testcase_70 AC 87 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
#include<math.h>

typedef int32_t i32;
typedef int64_t i64;

double PARAM = 0.0;

double func (double r) {
    if (2 * r < PARAM) {
        return 0;
    }
    double p = acos (PARAM / (2 * r)) * 2;
    return r * r * (p - sin(p));
}

double calc (void) {
    const i32 n = 1 << 23;
    double f = (double) 1 / n;
    double sum = 0;
    double i6 = (double)1 / 6;
    for (i32 i = n - 1; i >= 0; --i) {
        double r = (n - i) * f;
        double l = (n - 1 - i) * f;
        sum += (func(l) + 4 * func((l + r) * 0.5) + func(r)) * i6;
    }
    return sum * f;
}

void run (void) {
    double r, h, d;
    scanf ("%lf%lf%lf", &r, &h, &d);
    PARAM = d / r;
    double ans = r * r * h * calc();
    printf ("%7f", ans);
}

int main (void) {
    run();
    return 0;
}
0