結果

問題 No.1319 最強とんがりコーン
ユーザー butsurizukibutsurizuki
提出日時 2020-12-08 11:40:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 583 bytes
コンパイル時間 2,139 ms
コンパイル使用メモリ 200,968 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 17:05:32
合計ジャッジ時間 16,055 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,355 ms
4,348 KB
testcase_01 AC 1,399 ms
4,348 KB
testcase_02 AC 1,327 ms
4,348 KB
testcase_03 AC 822 ms
4,348 KB
testcase_04 AC 1,543 ms
4,348 KB
testcase_05 AC 1,842 ms
4,348 KB
testcase_06 AC 1,440 ms
4,348 KB
testcase_07 AC 931 ms
4,348 KB
testcase_08 AC 1,494 ms
4,348 KB
testcase_09 AC 1,965 ms
4,348 KB
testcase_10 AC 436 ms
4,348 KB
testcase_11 AC 1,047 ms
4,348 KB
testcase_12 AC 1,575 ms
4,348 KB
testcase_13 AC 1,105 ms
4,348 KB
testcase_14 AC 561 ms
4,348 KB
testcase_15 AC 1,186 ms
4,348 KB
testcase_16 AC 617 ms
4,348 KB
testcase_17 TLE -
testcase_18 AC 700 ms
4,348 KB
testcase_19 AC 1,933 ms
4,348 KB
testcase_20 AC 1,359 ms
4,348 KB
testcase_21 AC 1,403 ms
4,348 KB
testcase_22 AC 1,335 ms
4,348 KB
testcase_23 AC 1,352 ms
4,348 KB
testcase_24 AC 1,341 ms
4,348 KB
testcase_25 AC 1,379 ms
4,348 KB
testcase_26 AC 1,352 ms
4,348 KB
testcase_27 AC 1,341 ms
4,348 KB
testcase_28 AC 1,339 ms
4,348 KB
testcase_29 AC 1,329 ms
4,348 KB
testcase_30 AC 1,361 ms
4,348 KB
testcase_31 AC 1,366 ms
4,348 KB
testcase_32 AC 1,414 ms
4,348 KB
testcase_33 AC 1,780 ms
4,348 KB
testcase_34 AC 1,340 ms
4,348 KB
testcase_35 AC 1,384 ms
4,348 KB
testcase_36 AC 1,355 ms
4,348 KB
testcase_37 AC 1,376 ms
4,348 KB
testcase_38 AC 1,353 ms
4,348 KB
testcase_39 AC 1,531 ms
4,348 KB
testcase_40 AC 1,054 ms
4,348 KB
testcase_41 AC 422 ms
4,348 KB
testcase_42 AC 531 ms
4,348 KB
testcase_43 AC 439 ms
4,348 KB
testcase_44 AC 551 ms
4,348 KB
testcase_45 AC 422 ms
4,348 KB
testcase_46 AC 1,789 ms
4,348 KB
testcase_47 AC 467 ms
4,348 KB
testcase_48 AC 1,047 ms
4,348 KB
testcase_49 AC 484 ms
4,348 KB
testcase_50 AC 454 ms
4,348 KB
testcase_51 AC 403 ms
4,348 KB
testcase_52 AC 439 ms
4,348 KB
testcase_53 AC 374 ms
4,348 KB
testcase_54 AC 610 ms
4,348 KB
testcase_55 AC 541 ms
4,348 KB
testcase_56 AC 425 ms
4,348 KB
testcase_57 AC 380 ms
4,348 KB
testcase_58 AC 375 ms
4,348 KB
testcase_59 AC 368 ms
4,348 KB
testcase_60 AC 339 ms
4,348 KB
testcase_61 AC 341 ms
4,348 KB
testcase_62 AC 341 ms
4,348 KB
testcase_63 AC 342 ms
4,348 KB
testcase_64 AC 1,461 ms
4,348 KB
testcase_65 AC 1,460 ms
4,348 KB
testcase_66 AC 340 ms
4,348 KB
testcase_67 AC 1,325 ms
4,348 KB
testcase_68 TLE -
testcase_69 AC 1,332 ms
4,348 KB
testcase_70 AC 484 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define dvd 100000000

using namespace std;

//https://mathworld.wolfram.com/Circle-CircleIntersection.html
double f(double r,double d){
  if(2*r <= d){return 0.0;}
  double ac=acos(d/(2.0*r)),res,subt;
  res=2.0*r*r*ac;
  subt=0.5*d;
  subt*=sqrt((4.0*r*r-d*d));
  return res-subt;
}

int main(){
  double r,h,d,res=0.0;
  double s1,s2,bh;
  cin >> r >> h >> d;
  bh=(h/(double)dvd);
  s1=f(r,d);
  for(int i=1;i<=dvd;i++){
    double cr=r*(((double)(dvd-i))/((double)dvd));
    s2=f(cr,d);
    res+=(s1+s2);
    s1=s2;
  }
  printf("%.12lf\n",res*bh/2.0);
}
0