結果

問題 No.1319 最強とんがりコーン
ユーザー KudeKude
提出日時 2020-12-16 13:43:33
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,151 ms / 2,000 ms
コード長 1,402 bytes
コンパイル時間 3,031 ms
コンパイル使用メモリ 217,404 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 09:30:29
合計ジャッジ時間 67,882 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 764 ms
4,348 KB
testcase_01 AC 768 ms
4,348 KB
testcase_02 AC 828 ms
4,348 KB
testcase_03 AC 894 ms
4,348 KB
testcase_04 AC 758 ms
4,348 KB
testcase_05 AC 814 ms
4,348 KB
testcase_06 AC 833 ms
4,348 KB
testcase_07 AC 878 ms
4,348 KB
testcase_08 AC 838 ms
4,348 KB
testcase_09 AC 830 ms
4,348 KB
testcase_10 AC 1,075 ms
4,348 KB
testcase_11 AC 878 ms
4,348 KB
testcase_12 AC 831 ms
4,348 KB
testcase_13 AC 860 ms
4,348 KB
testcase_14 AC 955 ms
4,348 KB
testcase_15 AC 850 ms
4,348 KB
testcase_16 AC 932 ms
4,348 KB
testcase_17 AC 801 ms
4,348 KB
testcase_18 AC 986 ms
4,348 KB
testcase_19 AC 786 ms
4,348 KB
testcase_20 AC 755 ms
4,348 KB
testcase_21 AC 763 ms
4,348 KB
testcase_22 AC 764 ms
4,348 KB
testcase_23 AC 770 ms
4,348 KB
testcase_24 AC 760 ms
4,348 KB
testcase_25 AC 748 ms
4,348 KB
testcase_26 AC 751 ms
4,348 KB
testcase_27 AC 759 ms
4,348 KB
testcase_28 AC 760 ms
4,348 KB
testcase_29 AC 777 ms
4,348 KB
testcase_30 AC 774 ms
4,348 KB
testcase_31 AC 775 ms
4,348 KB
testcase_32 AC 848 ms
4,348 KB
testcase_33 AC 783 ms
4,348 KB
testcase_34 AC 764 ms
4,348 KB
testcase_35 AC 757 ms
4,348 KB
testcase_36 AC 762 ms
4,348 KB
testcase_37 AC 761 ms
4,348 KB
testcase_38 AC 764 ms
4,348 KB
testcase_39 AC 780 ms
4,348 KB
testcase_40 AC 878 ms
4,348 KB
testcase_41 AC 1,105 ms
4,348 KB
testcase_42 AC 1,003 ms
4,348 KB
testcase_43 AC 1,091 ms
4,348 KB
testcase_44 AC 996 ms
4,348 KB
testcase_45 AC 1,140 ms
4,348 KB
testcase_46 AC 843 ms
4,348 KB
testcase_47 AC 1,057 ms
4,348 KB
testcase_48 AC 898 ms
4,348 KB
testcase_49 AC 1,040 ms
4,348 KB
testcase_50 AC 1,075 ms
4,348 KB
testcase_51 AC 1,151 ms
4,348 KB
testcase_52 AC 1,098 ms
4,348 KB
testcase_53 AC 1,150 ms
4,348 KB
testcase_54 AC 968 ms
4,348 KB
testcase_55 AC 1,001 ms
4,348 KB
testcase_56 AC 1,112 ms
4,348 KB
testcase_57 AC 1,146 ms
4,348 KB
testcase_58 AC 1,147 ms
4,348 KB
testcase_59 AC 1,147 ms
4,348 KB
testcase_60 AC 519 ms
4,348 KB
testcase_61 AC 516 ms
4,348 KB
testcase_62 AC 517 ms
4,348 KB
testcase_63 AC 517 ms
4,348 KB
testcase_64 AC 922 ms
4,348 KB
testcase_65 AC 865 ms
4,348 KB
testcase_66 AC 516 ms
4,348 KB
testcase_67 AC 779 ms
4,348 KB
testcase_68 AC 836 ms
4,348 KB
testcase_69 AC 778 ms
4,348 KB
testcase_70 AC 1,043 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12);
    double rmax, h, d;
    cin >> rmax >> h >> d;
    const double rmin = d / 2;
    constexpr int num = 3e7;
    const double rstep = (rmax - rmin) / num;
    double ans = 0;
    rep(i, num) {
    //for(double r = rmin; r < rmax; r += rstep) {
        const double r = rmin + rstep * i;
        double t = acos(d / 2 / r);
        //ans += r * r * (2 * t - sin(2 * t));
        double x = 2 * t;
        double x2 = x * x;
        double z = 1;
        for(int i = 20; i >= 4; i -= 2) {
            z = 1 - x2 / (i * (i + 1)) * z;
        }
        z = r * r * x * x2 / 6 * z;
        //ans += r * r * (x2 * x / 6 * (1 - x2 / 20 * (1 - x2 / 42 * (1 - x2 / 72 * (1 - x2 / 110 * (1 - x2 / 156))))));
        ans += z;
    }
    ans *= rstep * h / rmax;
    cout << ans << endl;
}
0