結果

問題 No.2352 Sharpened Knife in Fall
ユーザー umezoumezo
提出日時 2023-06-16 23:05:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 687 bytes
コンパイル時間 1,856 ms
コンパイル使用メモリ 192,412 KB
最終ジャッジ日時 2025-02-14 21:26:49
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
 
#include<bits/stdc++.h>
using namespace std;

double r,k;
const double pi=acos(-1);
double f(double x) {
  return sqrt(r*r-x*x);
}
 
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  
  cin>>r>>k;
  
  double A=-r;
  double B=r;
  int N=1000000;

  const double delta=(B-A)/N;
  double value=0.0;
    
  double a=pi*r*r/2/(k+1);
  int now=1;
  for(int i=0;i<N;i++){
    double x=A+i*delta;      
    value+=(f(x)+f(x+delta)+4.0*f(x+delta/2.0))*delta/6.0;
    if(value>=a*now){
      printf("%.20f\n",x);
      now++;
    }
    if(now==k+1) break;
  }

  return 0;
}
0