結果

問題 No.2352 Sharpened Knife in Fall
ユーザー planesplanes
提出日時 2023-06-17 16:34:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 974 bytes
コンパイル時間 1,587 ms
コンパイル使用メモリ 171,004 KB
実行使用メモリ 4,672 KB
最終ジャッジ日時 2023-09-07 12:48:29
合計ジャッジ時間 11,072 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 278 ms
4,440 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 166 ms
4,384 KB
testcase_15 WA -
testcase_16 AC 18 ms
4,388 KB
testcase_17 AC 10 ms
4,384 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

  #include <bits/stdc++.h> 
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 #define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)

ll INF=2e18;
double R;
double pi=3.14159265358979;

double solve(double a) {
  double m=R*cos(a)*R*sin(a);
  m+=R*R*a;

  return pi*R*R/2-m;

}

int main() {
    ios::sync_with_stdio(false);
  cin.tie(0);

cin>>R;
ll  K;cin>>K;


double S=pi*R*R;
S/=(double)(K+1);

vector<double> ans(0);
if(K%2!=0) ans.push_back(0.0);
K/=2;

double last=pi/2.0*10000000000000.0;



for(ll i=0;i<K;i++) {
double a=(double)last/10000000000000.0;
ll s=0; ll g=last;

  while(s<g) {
    ll k=(s+g)/2;
    double x=(double)k/10000000000000.0;

    if(solve(x)-solve(a)<=S) {
      g=k;
    }
      else s=k+1;
    }

last=s;
ans.push_back(last/10000000000000.0);
ans.push_back(-1*last/10000000000000.0);
}


sort(all(ans));
cout<<fixed<<setprecision(10);

for(auto x:ans) cout<<R*sin(x)<<endl;



  }






0