Abracadabra

This is the post excerpt.

I’ve always be longing to own a blog of my own, but I am never able to deal with the annoying hosting stuff. And today, I finally decided to use wordpress – use money to fill the emptiness of knowledge. That’s fair.

 

Anyway, I am having this very own blog now. I’m using it to record my coding training for programming contests. I had been using github but… it’s just not the same and you have no idea how I envied others for their blogs.

 

Hopefully I’ll truly “knee the way to my chosen dream”, and I hope you enjoy reading my tiny steps.

post

2017 PacNW E Straight Shot

/* 11/16/2017
* Solution: Use binary search to find the appropriate angle.
*/

#include
#include
#include
#define PI acos(-1)
using namespace std;

int main() {
	long long n, x;
	double vv;
	int ll, rr;
	double v;
	double summ = 0;
	cin >> n >> x >> v;
	for (int i = 1; i > ll >> rr >> vv;
		summ += (rr - ll) * 1.0 * vv / v;
	}
	if (summ > 0) {
		summ = - summ;
	}
	double l = 0, r = 90;
	double result = 100;
	while (abs(result) > 1e-5) {
		if (l > 60) {
			cout  60) {
		cout << "Too hard";
	} else {
		cout << fixed << setprecision(3) << (double)x / (v * cos(l * PI / 180));
	}
	return 0;
}