結果

問題 No.2352 Sharpened Knife in Fall
ユーザー SSRSSSRS
提出日時 2023-06-16 21:31:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 710 ms / 3,000 ms
コード長 524 bytes
コンパイル時間 1,548 ms
コンパイル使用メモリ 166,024 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 18:46:25
合計ジャッジ時間 18,581 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 605 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 706 ms
4,384 KB
testcase_07 AC 350 ms
4,384 KB
testcase_08 AC 702 ms
4,380 KB
testcase_09 AC 710 ms
4,384 KB
testcase_10 AC 700 ms
4,380 KB
testcase_11 AC 705 ms
4,384 KB
testcase_12 AC 708 ms
4,384 KB
testcase_13 AC 701 ms
4,384 KB
testcase_14 AC 331 ms
4,384 KB
testcase_15 AC 662 ms
4,380 KB
testcase_16 AC 36 ms
4,384 KB
testcase_17 AC 17 ms
4,380 KB
testcase_18 AC 254 ms
4,384 KB
testcase_19 AC 555 ms
4,384 KB
testcase_20 AC 217 ms
4,384 KB
testcase_21 AC 206 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
double F(double x){
  return (x * sqrt(1 - x * x) + asin(x)) / 2;
}
int main(){
  cout << fixed << setprecision(20);
  int R, K;
  cin >> R >> K;
  for (int i = 1; i <= K; i++){
    double tv = -1, fv = 1;
    for (int j = 0; j < 100; j++){
      double mid = (tv + fv) / 2;
      double area = F(mid) - F(-1);
      if (area / PI * 2 * (K + 1) <= i){
        tv = mid;
      } else {
        fv = mid;
      }
    }
    cout << tv * R << endl;
  }
}
0