結果

問題 No.2352 Sharpened Knife in Fall
ユーザー uetaueta
提出日時 2023-06-17 00:46:52
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 721 ms / 3,000 ms
コード長 4,315 bytes
コンパイル時間 2,204 ms
コンパイル使用メモリ 166,368 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-24 17:48:18
合計ジャッジ時間 20,562 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 568 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 705 ms
5,376 KB
testcase_07 AC 355 ms
5,376 KB
testcase_08 AC 712 ms
5,376 KB
testcase_09 AC 711 ms
5,376 KB
testcase_10 AC 709 ms
5,376 KB
testcase_11 AC 705 ms
5,376 KB
testcase_12 AC 713 ms
5,376 KB
testcase_13 AC 721 ms
5,376 KB
testcase_14 AC 332 ms
5,376 KB
testcase_15 AC 667 ms
5,376 KB
testcase_16 AC 36 ms
5,376 KB
testcase_17 AC 18 ms
5,376 KB
testcase_18 AC 253 ms
5,376 KB
testcase_19 AC 552 ms
5,376 KB
testcase_20 AC 216 ms
5,376 KB
testcase_21 AC 208 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <cstdint>
#define rp(n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define Per(i,sta,n) for(int i=n-1;i>=sta;i--)
#define fore(i, a) for(auto &&i : a)
#define foreP(a, b, v) for(auto &&[a, b] : v)
#define foreP3(a, b, c, v) for(auto &&[a, b, c] : v)
#define fitr(itr, m) for(auto &&itr=m.begin();itr!=m.end();itr++)
#define all(v) (v).begin(),(v).end()
#define Sum(a) accumulate(all(a),0LL)
#define VC vector
#define TP tuple

using namespace std;
mt19937 engine(time(0));

using ll = long long;
using ld = long double;
constexpr long long mod = 998244353;
// constexpr long long mod = 1000000007;
// constexpr long long mod = 100000000000000003;
constexpr long double PI=3.1415926535897932384626433832795028841971;
constexpr long long inf = INT_MAX;
constexpr long long infll = LONG_MAX;

template<typename T>using MaxHeap = priority_queue<T>;
template<typename T>using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<typename T>void chmin(T& a, T b) {a = min(a, b);}
template<typename T>void chmax(T& a, T b) {a = max(a, b);}

template<typename T>void debug(T a){cerr << a <<  endl;}
template<typename T,typename S>void debug(T a, S b){cerr << a << " " << b << endl;}
template<typename T,typename S,typename U>void debug(T a,S b,U c){cerr <<"( "<< a << " " << b << " " << c <<" )" << endl;}
template<typename T,typename S,typename U,typename W>void debug(T a,S b,U c,W d){cerr <<"( "<< a << " " << b << " " << c<< " " << d <<" )" << endl;}
template<typename T>void debug(vector<T> v){for(int i=0;i<v.size();i++)cerr << v[i] << " ";cerr << endl;}
template<typename T>void debug(set<T> m){for(auto itr: m){cerr << itr << " ";}cerr << endl;}
template<typename T,typename S>void debug(map<T,S> m){for(auto itr=m.begin();itr!=m.end();itr++)cerr <<"("<< itr->first << " => " << itr->second<<")" << endl;}
template<typename T,typename S>void debug(pair<T,S> p){cerr <<"( "<< p.first << ", " << p.second <<" )" << endl;}
template<typename T,typename S>void debug(tuple<T,S> t){cerr <<"( "<< get<0>(t) << ", " << get<1>(t) <<" )" << endl;}
template<typename T,typename S,typename U>void debug(tuple<T,S,U> t){cerr <<"( "<< get<0>(t) << ", " << get<1>(t)<< ", " << get<2>(t) <<" )" << endl;}
template<typename T,typename S,typename U,typename W>void debug(tuple<T,S,U,W> t){cerr <<"( "<< get<0>(t) << ", " << get<1>(t)<< ", " << get<2>(t)<< ", " << get<3>(t) <<" )" << endl;}

template<typename T>void out(T a){ cout << a << endl;}
template<typename T,typename S>void out(T a,S b){ cout << a <<" " << b << endl;}
template<typename T,typename S,typename U>void out(T a,S b,U c){ cout << a <<" " << b <<" " << c << endl;}
template<typename T>void out(vector<T> v){ for(int i=0;i<v.size();i++){cout << v[i];if(i==v.size()-1) cout << endl;else cout << " ";}}
template<typename T>void out(set<T> m){for(auto itr: m){cout << itr; if((itr+1)==m.endl()) cout << endl;else cout << " ";}}
template<typename T,typename S>void out(pair<T,S> p){cout << p.first << " " << p.second << endl;}
template<typename T,typename S>void out(tuple<T,S> t){cout << get<0>(t) << " " << get<1>(t) << endl;}
template<typename T,typename S,typename U>void out(tuple<T,S,U> t){cout << get<0>(t) << " " << get<1>(t)<< " " << get<2>(t) << endl;}
void yes(bool f=1,string yes="Yes",string no="No"){if(f){cout << yes << endl;}else{cout << no << endl;}}


struct  S
{
	int x;
	int y;
	S(int x, int y) : x(x),y(y){}
	bool operator<(const struct S& other) const
	{
		return x < other.x;
	}
	void debug(){
		cerr <<"debug " << x <<"-" << y << endl;
	}
};

void solve(){
	ld R;
	int k;
	cin >> R >> k;
	VC<ld> p(k,0.0);
	rep(i,k){
		ld s = PI/2.0*(i+1)/(k+1);
		ld l = -1,r = 1;
		while (r-l>0.0000000001)
		{
			ld c = (r-l)/2+l;
			// debug(c);
			ld sita=acos(c);
			ld ss;
				if(c<0)
					ss = PI-sita/2.0-abs(c)*sqrt(1.0-c*c)/2.0;
				else
					ss = sita/2.0-abs(c)*sqrt(1.0-c*c)/2.0;
			if(s<=ss){
				l = c;
			}else{
				r = c;
			}
		}
		p[i] = l*R;
	}

	rep(i,k/2){
		p[i+k/2] = -1*p[i];
	}
	sort(all(p));
	rep(i,k)out(p[i]);
	return;
}

int main()
{
	cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed << std::setprecision(30);
	int t=1;
	// cin >> t;
	while(t--)
		solve();
	return 0;
}
0