結果

問題 No.1319 最強とんがりコーン
ユーザー DaYuanChiDaYuanChi
提出日時 2021-01-21 20:36:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 543 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 1,427 ms
コンパイル使用メモリ 163,736 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 08:16:40
合計ジャッジ時間 32,218 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 240 ms
4,376 KB
testcase_01 AC 249 ms
4,376 KB
testcase_02 AC 438 ms
4,376 KB
testcase_03 AC 454 ms
4,380 KB
testcase_04 AC 278 ms
4,384 KB
testcase_05 AC 403 ms
4,376 KB
testcase_06 AC 428 ms
4,376 KB
testcase_07 AC 455 ms
4,380 KB
testcase_08 AC 444 ms
4,380 KB
testcase_09 AC 396 ms
4,376 KB
testcase_10 AC 513 ms
4,376 KB
testcase_11 AC 443 ms
4,380 KB
testcase_12 AC 413 ms
4,376 KB
testcase_13 AC 437 ms
4,376 KB
testcase_14 AC 476 ms
4,376 KB
testcase_15 AC 439 ms
4,376 KB
testcase_16 AC 455 ms
4,380 KB
testcase_17 AC 377 ms
4,376 KB
testcase_18 AC 457 ms
4,380 KB
testcase_19 AC 351 ms
4,380 KB
testcase_20 AC 245 ms
4,376 KB
testcase_21 AC 254 ms
4,376 KB
testcase_22 AC 246 ms
4,380 KB
testcase_23 AC 252 ms
4,380 KB
testcase_24 AC 244 ms
4,376 KB
testcase_25 AC 257 ms
4,376 KB
testcase_26 AC 247 ms
4,376 KB
testcase_27 AC 248 ms
4,376 KB
testcase_28 AC 233 ms
4,376 KB
testcase_29 AC 243 ms
4,376 KB
testcase_30 AC 247 ms
4,380 KB
testcase_31 AC 251 ms
4,376 KB
testcase_32 AC 441 ms
4,376 KB
testcase_33 AC 320 ms
4,376 KB
testcase_34 AC 243 ms
4,376 KB
testcase_35 AC 254 ms
4,376 KB
testcase_36 AC 247 ms
4,376 KB
testcase_37 AC 252 ms
4,376 KB
testcase_38 AC 246 ms
4,376 KB
testcase_39 AC 282 ms
4,380 KB
testcase_40 AC 463 ms
4,380 KB
testcase_41 AC 526 ms
4,376 KB
testcase_42 AC 491 ms
4,380 KB
testcase_43 AC 513 ms
4,380 KB
testcase_44 AC 490 ms
4,376 KB
testcase_45 AC 538 ms
4,380 KB
testcase_46 AC 429 ms
4,380 KB
testcase_47 AC 516 ms
4,376 KB
testcase_48 AC 463 ms
4,376 KB
testcase_49 AC 499 ms
4,376 KB
testcase_50 AC 523 ms
4,376 KB
testcase_51 AC 543 ms
4,376 KB
testcase_52 AC 523 ms
4,376 KB
testcase_53 AC 527 ms
4,376 KB
testcase_54 AC 487 ms
4,376 KB
testcase_55 AC 494 ms
4,380 KB
testcase_56 AC 531 ms
4,380 KB
testcase_57 AC 528 ms
4,376 KB
testcase_58 AC 533 ms
4,376 KB
testcase_59 AC 532 ms
4,380 KB
testcase_60 AC 213 ms
4,376 KB
testcase_61 AC 205 ms
4,380 KB
testcase_62 AC 204 ms
4,376 KB
testcase_63 AC 208 ms
4,380 KB
testcase_64 AC 452 ms
4,380 KB
testcase_65 AC 458 ms
4,380 KB
testcase_66 AC 207 ms
4,376 KB
testcase_67 AC 253 ms
4,380 KB
testcase_68 AC 413 ms
4,376 KB
testcase_69 AC 248 ms
4,376 KB
testcase_70 AC 515 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

double r, h, d;

//断面積S
double S(double x){
  return 2*x*x*acos(d/(2.0*x))-d*sqrt(x*x-d*d/4);
}

int main(){
  cin >> r >> h >> d;
  double range = r - d*0.5;
  int num = 10000000;
  double dr = range / num;
  double vol = 0;
  for(int i = 0; i < num; i++){
    vol += h/r*(S(d*0.5+i*dr)+S(d*0.5+(i+1)*dr))*dr/2;
  }
  printf("%.10f\n",vol);
  return 0;
}
    
  
0