結果

問題 No.1319 最強とんがりコーン
ユーザー KudeKude
提出日時 2020-12-16 13:46:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,270 ms / 2,000 ms
コード長 1,413 bytes
コンパイル時間 3,085 ms
コンパイル使用メモリ 217,372 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-20 09:32:39
合計ジャッジ時間 72,369 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 750 ms
4,348 KB
testcase_01 AC 785 ms
4,348 KB
testcase_02 AC 969 ms
4,348 KB
testcase_03 AC 1,010 ms
4,348 KB
testcase_04 AC 904 ms
4,348 KB
testcase_05 AC 1,037 ms
4,348 KB
testcase_06 AC 963 ms
4,348 KB
testcase_07 AC 1,005 ms
4,348 KB
testcase_08 AC 962 ms
4,348 KB
testcase_09 AC 1,091 ms
4,348 KB
testcase_10 AC 1,205 ms
4,348 KB
testcase_11 AC 992 ms
4,348 KB
testcase_12 AC 957 ms
4,348 KB
testcase_13 AC 982 ms
4,348 KB
testcase_14 AC 1,080 ms
4,348 KB
testcase_15 AC 975 ms
4,348 KB
testcase_16 AC 1,054 ms
4,348 KB
testcase_17 AC 1,135 ms
4,348 KB
testcase_18 AC 1,035 ms
4,348 KB
testcase_19 AC 1,098 ms
4,348 KB
testcase_20 AC 753 ms
4,348 KB
testcase_21 AC 786 ms
4,348 KB
testcase_22 AC 737 ms
4,348 KB
testcase_23 AC 750 ms
4,348 KB
testcase_24 AC 744 ms
4,348 KB
testcase_25 AC 774 ms
4,348 KB
testcase_26 AC 749 ms
4,348 KB
testcase_27 AC 740 ms
4,348 KB
testcase_28 AC 738 ms
4,348 KB
testcase_29 AC 737 ms
4,348 KB
testcase_30 AC 759 ms
4,348 KB
testcase_31 AC 754 ms
4,348 KB
testcase_32 AC 960 ms
4,348 KB
testcase_33 AC 1,067 ms
4,348 KB
testcase_34 AC 740 ms
4,348 KB
testcase_35 AC 773 ms
4,348 KB
testcase_36 AC 749 ms
4,348 KB
testcase_37 AC 768 ms
4,348 KB
testcase_38 AC 741 ms
4,348 KB
testcase_39 AC 885 ms
4,348 KB
testcase_40 AC 989 ms
4,348 KB
testcase_41 AC 1,246 ms
4,348 KB
testcase_42 AC 1,101 ms
4,348 KB
testcase_43 AC 1,213 ms
4,348 KB
testcase_44 AC 1,090 ms
4,348 KB
testcase_45 AC 1,261 ms
4,348 KB
testcase_46 AC 1,003 ms
4,348 KB
testcase_47 AC 1,164 ms
4,348 KB
testcase_48 AC 987 ms
4,348 KB
testcase_49 AC 1,142 ms
4,348 KB
testcase_50 AC 1,184 ms
4,348 KB
testcase_51 AC 1,270 ms
4,348 KB
testcase_52 AC 1,208 ms
4,348 KB
testcase_53 AC 1,244 ms
4,348 KB
testcase_54 AC 1,059 ms
4,348 KB
testcase_55 AC 1,093 ms
4,348 KB
testcase_56 AC 1,244 ms
4,348 KB
testcase_57 AC 1,259 ms
4,348 KB
testcase_58 AC 1,250 ms
4,348 KB
testcase_59 AC 1,231 ms
4,348 KB
testcase_60 AC 383 ms
4,348 KB
testcase_61 AC 383 ms
4,348 KB
testcase_62 AC 382 ms
4,348 KB
testcase_63 AC 384 ms
4,348 KB
testcase_64 AC 959 ms
4,348 KB
testcase_65 AC 961 ms
4,348 KB
testcase_66 AC 383 ms
4,348 KB
testcase_67 AC 729 ms
4,348 KB
testcase_68 AC 1,123 ms
4,348 KB
testcase_69 AC 730 ms
4,348 KB
testcase_70 AC 1,140 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