結果

問題 No.1319 最強とんがりコーン
ユーザー akakimidoriakakimidori
提出日時 2020-12-17 01:37:32
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 739 bytes
コンパイル時間 1,049 ms
コンパイル使用メモリ 31,276 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 10:21:33
合計ジャッジ時間 19,335 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,729 ms
4,348 KB
testcase_01 AC 1,790 ms
4,348 KB
testcase_02 AC 1,043 ms
4,348 KB
testcase_03 AC 587 ms
4,348 KB
testcase_04 AC 1,998 ms
4,348 KB
testcase_05 AC 1,763 ms
4,348 KB
testcase_06 AC 1,144 ms
4,348 KB
testcase_07 AC 685 ms
4,348 KB
testcase_08 AC 1,203 ms
4,348 KB
testcase_09 AC 1,975 ms
4,348 KB
testcase_10 AC 242 ms
4,348 KB
testcase_11 AC 791 ms
4,348 KB
testcase_12 AC 1,290 ms
4,348 KB
testcase_13 AC 843 ms
4,348 KB
testcase_14 AC 350 ms
4,348 KB
testcase_15 AC 903 ms
4,348 KB
testcase_16 AC 401 ms
4,348 KB
testcase_17 TLE -
testcase_18 AC 476 ms
4,348 KB
testcase_19 TLE -
testcase_20 AC 1,728 ms
4,348 KB
testcase_21 AC 1,795 ms
4,348 KB
testcase_22 AC 1,700 ms
4,348 KB
testcase_23 AC 1,748 ms
4,348 KB
testcase_24 AC 1,707 ms
4,348 KB
testcase_25 AC 1,762 ms
4,348 KB
testcase_26 AC 1,717 ms
4,348 KB
testcase_27 AC 1,708 ms
4,348 KB
testcase_28 AC 1,698 ms
4,348 KB
testcase_29 AC 1,691 ms
4,348 KB
testcase_30 AC 1,745 ms
4,348 KB
testcase_31 AC 1,736 ms
4,348 KB
testcase_32 AC 1,123 ms
4,348 KB
testcase_33 TLE -
testcase_34 AC 1,705 ms
4,348 KB
testcase_35 AC 1,770 ms
4,348 KB
testcase_36 AC 1,726 ms
4,348 KB
testcase_37 AC 1,753 ms
4,348 KB
testcase_38 AC 1,719 ms
4,348 KB
testcase_39 AC 1,968 ms
4,348 KB
testcase_40 AC 793 ms
4,348 KB
testcase_41 AC 225 ms
4,348 KB
testcase_42 AC 321 ms
4,348 KB
testcase_43 AC 238 ms
4,348 KB
testcase_44 AC 337 ms
4,348 KB
testcase_45 AC 189 ms
4,348 KB
testcase_46 AC 1,636 ms
4,348 KB
testcase_47 AC 264 ms
4,348 KB
testcase_48 AC 789 ms
4,348 KB
testcase_49 AC 281 ms
4,348 KB
testcase_50 AC 253 ms
4,348 KB
testcase_51 AC 205 ms
4,348 KB
testcase_52 AC 240 ms
4,348 KB
testcase_53 WA -
testcase_54 AC 395 ms
4,348 KB
testcase_55 AC 335 ms
4,348 KB
testcase_56 AC 228 ms
4,348 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 AC 127 ms
4,348 KB
testcase_61 AC 127 ms
4,348 KB
testcase_62 AC 127 ms
4,348 KB
testcase_63 AC 129 ms
4,348 KB
testcase_64 AC 1,165 ms
4,348 KB
testcase_65 AC 1,163 ms
4,348 KB
testcase_66 AC 127 ms
4,348 KB
testcase_67 AC 1,685 ms
4,348 KB
testcase_68 TLE -
testcase_69 AC 1,684 ms
4,348 KB
testcase_70 AC 284 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 << 26;
    double f = (double) 1 / n;
    double sum = 0;
    for (i32 i = n - 1; i >= 0; --i) {
        double r = (n - i) * f;
        sum += func(r);
    }
    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