結果

問題 No.1319 最強とんがりコーン
ユーザー butsurizukibutsurizuki
提出日時 2020-12-08 11:42:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 641 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 201,040 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 17:07:27
合計ジャッジ時間 81,118 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,369 ms
4,348 KB
testcase_01 AC 1,415 ms
4,348 KB
testcase_02 AC 1,316 ms
4,348 KB
testcase_03 AC 818 ms
4,348 KB
testcase_04 AC 1,575 ms
4,348 KB
testcase_05 AC 1,871 ms
4,348 KB
testcase_06 AC 1,430 ms
4,348 KB
testcase_07 AC 924 ms
4,348 KB
testcase_08 AC 1,483 ms
4,348 KB
testcase_09 AC 1,989 ms
4,348 KB
testcase_10 AC 437 ms
4,348 KB
testcase_11 AC 1,038 ms
4,348 KB
testcase_12 AC 1,577 ms
4,348 KB
testcase_13 AC 1,097 ms
4,348 KB
testcase_14 AC 561 ms
4,348 KB
testcase_15 AC 1,166 ms
4,348 KB
testcase_16 AC 618 ms
4,348 KB
testcase_17 TLE -
testcase_18 AC 697 ms
4,348 KB
testcase_19 AC 1,994 ms
4,348 KB
testcase_20 AC 1,372 ms
4,348 KB
testcase_21 AC 1,418 ms
4,348 KB
testcase_22 AC 1,346 ms
4,348 KB
testcase_23 AC 1,366 ms
4,348 KB
testcase_24 AC 1,354 ms
4,348 KB
testcase_25 AC 1,398 ms
4,348 KB
testcase_26 AC 1,360 ms
4,348 KB
testcase_27 AC 1,345 ms
4,348 KB
testcase_28 AC 1,346 ms
4,348 KB
testcase_29 AC 1,340 ms
4,348 KB
testcase_30 AC 1,380 ms
4,348 KB
testcase_31 AC 1,373 ms
4,348 KB
testcase_32 AC 1,404 ms
4,348 KB
testcase_33 AC 1,827 ms
4,348 KB
testcase_34 AC 1,350 ms
4,348 KB
testcase_35 AC 1,400 ms
4,348 KB
testcase_36 AC 1,365 ms
4,348 KB
testcase_37 AC 1,393 ms
4,348 KB
testcase_38 AC 1,362 ms
4,348 KB
testcase_39 AC 1,555 ms
4,348 KB
testcase_40 AC 1,043 ms
4,348 KB
testcase_41 AC 423 ms
4,348 KB
testcase_42 AC 528 ms
4,348 KB
testcase_43 AC 436 ms
4,348 KB
testcase_44 AC 546 ms
4,348 KB
testcase_45 AC 403 ms
4,348 KB
testcase_46 AC 1,814 ms
4,348 KB
testcase_47 AC 466 ms
4,348 KB
testcase_48 AC 1,039 ms
4,348 KB
testcase_49 AC 484 ms
4,348 KB
testcase_50 AC 452 ms
4,348 KB
testcase_51 AC 401 ms
4,348 KB
testcase_52 AC 438 ms
4,348 KB
testcase_53 AC 375 ms
4,348 KB
testcase_54 AC 610 ms
4,348 KB
testcase_55 AC 541 ms
4,348 KB
testcase_56 AC 424 ms
4,348 KB
testcase_57 AC 380 ms
4,348 KB
testcase_58 AC 374 ms
4,348 KB
testcase_59 AC 367 ms
4,348 KB
testcase_60 AC 339 ms
4,348 KB
testcase_61 AC 340 ms
4,348 KB
testcase_62 AC 340 ms
4,348 KB
testcase_63 AC 340 ms
4,348 KB
testcase_64 AC 1,449 ms
4,348 KB
testcase_65 AC 1,452 ms
4,348 KB
testcase_66 AC 340 ms
4,348 KB
testcase_67 AC 1,335 ms
4,348 KB
testcase_68 TLE -
testcase_69 AC 1,337 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;
  assert(r<=10000.0 && h<=10000.0);
  assert(d <= 2.0*r);
  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