結果

問題 No.1319 最強とんがりコーン
ユーザー pes_magicpes_magic
提出日時 2020-12-16 23:26:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 767 bytes
コンパイル時間 3,653 ms
コンパイル使用メモリ 78,460 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-20 09:56:38
合計ジャッジ時間 9,082 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
4,372 KB
testcase_01 AC 52 ms
4,372 KB
testcase_02 AC 52 ms
4,372 KB
testcase_03 AC 51 ms
4,372 KB
testcase_04 AC 51 ms
4,372 KB
testcase_05 AC 51 ms
4,372 KB
testcase_06 AC 50 ms
4,372 KB
testcase_07 AC 52 ms
4,372 KB
testcase_08 AC 51 ms
4,372 KB
testcase_09 AC 52 ms
4,372 KB
testcase_10 AC 51 ms
4,372 KB
testcase_11 AC 52 ms
4,372 KB
testcase_12 AC 51 ms
4,372 KB
testcase_13 AC 52 ms
4,372 KB
testcase_14 AC 52 ms
4,372 KB
testcase_15 AC 53 ms
4,372 KB
testcase_16 AC 52 ms
4,372 KB
testcase_17 AC 52 ms
4,372 KB
testcase_18 AC 52 ms
4,372 KB
testcase_19 AC 52 ms
4,372 KB
testcase_20 AC 52 ms
4,372 KB
testcase_21 AC 52 ms
4,372 KB
testcase_22 AC 52 ms
4,372 KB
testcase_23 AC 52 ms
4,372 KB
testcase_24 AC 51 ms
4,372 KB
testcase_25 AC 52 ms
4,372 KB
testcase_26 AC 51 ms
4,372 KB
testcase_27 AC 50 ms
4,372 KB
testcase_28 AC 51 ms
4,372 KB
testcase_29 AC 52 ms
4,372 KB
testcase_30 AC 52 ms
4,372 KB
testcase_31 AC 51 ms
4,372 KB
testcase_32 AC 52 ms
4,372 KB
testcase_33 AC 52 ms
4,372 KB
testcase_34 AC 52 ms
4,372 KB
testcase_35 AC 52 ms
4,372 KB
testcase_36 AC 51 ms
4,372 KB
testcase_37 AC 51 ms
4,372 KB
testcase_38 AC 51 ms
4,372 KB
testcase_39 AC 52 ms
4,372 KB
testcase_40 AC 52 ms
4,372 KB
testcase_41 AC 52 ms
4,372 KB
testcase_42 AC 51 ms
4,372 KB
testcase_43 AC 51 ms
4,372 KB
testcase_44 AC 50 ms
4,372 KB
testcase_45 AC 50 ms
4,372 KB
testcase_46 AC 52 ms
4,372 KB
testcase_47 AC 51 ms
4,372 KB
testcase_48 AC 51 ms
4,372 KB
testcase_49 AC 51 ms
4,372 KB
testcase_50 AC 51 ms
4,372 KB
testcase_51 AC 50 ms
4,372 KB
testcase_52 AC 50 ms
4,372 KB
testcase_53 AC 51 ms
4,372 KB
testcase_54 AC 51 ms
4,372 KB
testcase_55 AC 52 ms
4,372 KB
testcase_56 AC 51 ms
4,372 KB
testcase_57 AC 52 ms
4,372 KB
testcase_58 AC 51 ms
4,372 KB
testcase_59 AC 50 ms
4,372 KB
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 AC 53 ms
4,372 KB
testcase_65 AC 52 ms
4,372 KB
testcase_66 WA -
testcase_67 AC 52 ms
4,372 KB
testcase_68 AC 52 ms
4,372 KB
testcase_69 AC 51 ms
4,372 KB
testcase_70 AC 51 ms
4,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
#include <cmath>

using namespace std;

int main(){
    double R, H, D; cin >> R >> H >> D;
    D *= 0.5;

    auto area = [&](double d){
        return 0.5*H/R*(d*d*(log(d)-log(R+sqrt(R*R-d*d))) + R*sqrt(R*R-d*d));
    };
    double a = 0.0;
    double pre = area(D);
    double preD = D;
    for(int i=1;i<=1000000;i++){
        double r = 0.000001 * i;
        double d = (1-r)*D + r * R;
        double a1 = area(0.5*(preD+d));
        double a2 = area(d);
        a += (d-preD)/6*(pre+4*a1+a2);
        preD = d;
        pre = a2;
    }
    printf("%.8lf\n", 4*a);
    // double res = 1.0/6*H*R*(D*D*D*log(D) + 2*D*R*sqrt(R*R-D*D) + R*R*R*atan(D/sqrt(R*R-D*D)) - D*D*D*log(sqrt(R*R-D*D)+R));
    // printf("%.8lf\n", -res);
}
0