結果

問題 No.1319 最強とんがりコーン
ユーザー akakimidoriakakimidori
提出日時 2020-12-17 01:40:54
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1,703 ms / 2,000 ms
コード長 817 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 31,796 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 10:22:52
合計ジャッジ時間 56,944 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,259 ms
4,348 KB
testcase_01 AC 1,308 ms
4,348 KB
testcase_02 AC 759 ms
4,348 KB
testcase_03 AC 412 ms
4,348 KB
testcase_04 AC 1,470 ms
4,348 KB
testcase_05 AC 1,304 ms
4,348 KB
testcase_06 AC 840 ms
4,348 KB
testcase_07 AC 486 ms
4,348 KB
testcase_08 AC 881 ms
4,348 KB
testcase_09 AC 1,459 ms
4,348 KB
testcase_10 AC 144 ms
4,348 KB
testcase_11 AC 564 ms
4,348 KB
testcase_12 AC 956 ms
4,348 KB
testcase_13 AC 606 ms
4,348 KB
testcase_14 AC 227 ms
4,348 KB
testcase_15 AC 654 ms
4,348 KB
testcase_16 AC 267 ms
4,348 KB
testcase_17 AC 1,703 ms
4,348 KB
testcase_18 AC 324 ms
4,348 KB
testcase_19 AC 1,684 ms
4,348 KB
testcase_20 AC 1,260 ms
4,348 KB
testcase_21 AC 1,311 ms
4,348 KB
testcase_22 AC 1,233 ms
4,348 KB
testcase_23 AC 1,255 ms
4,348 KB
testcase_24 AC 1,246 ms
4,348 KB
testcase_25 AC 1,287 ms
4,348 KB
testcase_26 AC 1,251 ms
4,348 KB
testcase_27 AC 1,232 ms
4,348 KB
testcase_28 AC 1,235 ms
4,348 KB
testcase_29 AC 1,235 ms
4,348 KB
testcase_30 AC 1,266 ms
4,348 KB
testcase_31 AC 1,262 ms
4,348 KB
testcase_32 AC 821 ms
4,348 KB
testcase_33 AC 1,672 ms
4,348 KB
testcase_34 AC 1,238 ms
4,348 KB
testcase_35 AC 1,287 ms
4,348 KB
testcase_36 AC 1,256 ms
4,348 KB
testcase_37 AC 1,281 ms
4,348 KB
testcase_38 AC 1,250 ms
4,348 KB
testcase_39 AC 1,442 ms
4,348 KB
testcase_40 AC 566 ms
4,348 KB
testcase_41 AC 133 ms
4,348 KB
testcase_42 AC 206 ms
4,348 KB
testcase_43 AC 140 ms
4,348 KB
testcase_44 AC 218 ms
4,348 KB
testcase_45 AC 105 ms
4,348 KB
testcase_46 AC 1,209 ms
4,348 KB
testcase_47 AC 165 ms
4,348 KB
testcase_48 AC 563 ms
4,348 KB
testcase_49 AC 176 ms
4,348 KB
testcase_50 AC 155 ms
4,348 KB
testcase_51 AC 119 ms
4,348 KB
testcase_52 AC 144 ms
4,348 KB
testcase_53 AC 90 ms
4,348 KB
testcase_54 AC 262 ms
4,348 KB
testcase_55 AC 215 ms
4,348 KB
testcase_56 AC 135 ms
4,348 KB
testcase_57 AC 96 ms
4,348 KB
testcase_58 AC 91 ms
4,348 KB
testcase_59 AC 85 ms
4,348 KB
testcase_60 AC 60 ms
4,348 KB
testcase_61 AC 59 ms
4,348 KB
testcase_62 AC 60 ms
4,348 KB
testcase_63 AC 59 ms
4,348 KB
testcase_64 AC 852 ms
4,348 KB
testcase_65 AC 849 ms
4,348 KB
testcase_66 AC 59 ms
4,348 KB
testcase_67 AC 1,228 ms
4,348 KB
testcase_68 AC 1,594 ms
4,348 KB
testcase_69 AC 1,224 ms
4,348 KB
testcase_70 AC 175 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 << 24;
    double f = (double) 1 / n;
    double sum = 0;
    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)) / 6;
    }
    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