結果
| 問題 |
No.760 Where am I moved to?
|
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2018-12-08 10:27:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,616 bytes |
| コンパイル時間 | 715 ms |
| コンパイル使用メモリ | 95,828 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-25 05:41:05 |
| 合計ジャッジ時間 | 6,594 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
using namespace std;
typedef long long int ll;
//typedef pair<int, int> P;
const double PI=acos(-1.0);
const double EPS=1e-10;
double add(double a, double b){
if(abs(a+b)<EPS*(abs(a)+abs(b))) return 0;
return a+b;
}
struct P{
double x, y;
P() {}
P(double x, double y): x(x), y(y){
}
P operator+ (P p){
return P(add(x, p.x), add(y, p.y));
}
P operator- (P p){
return P(add(x, -p.x), add(y, -p.y));
}
P operator* (double d){
return P(x*d, y*d);
}
double dot(P p){
return add(x*p.x, y*p.y);
}
double det(P p){
return add(x*p.y, -y*p.x);
}
bool operator< (const P& p) const{
if(abs(x-p.x)>EPS){
return x<p.x;
}else{
return y<p.y-EPS;
}
}
};
double atan(P p){
return atan2(p.y, p.x);
}
P rot(P p, double t){
return P(p.x*cos(t)-p.y*sin(t), p.x*sin(t)+p.y*cos(t));
}
int main()
{
double xa, ya, ta;
cin>>xa>>ya>>ta;
ta=ta/180*PI;
P p0=P(xa, ya);
double x11, y11, x12, y12, x21, y21, x22, y22;
cin>>x11>>y11>>x12>>y12>>x21>>y21>>x22>>y22;
P p1=P(x11, y11), p2=P(x12, y12), q1=P(x21, y21), q2=P(x22, y22);
double t=atan(p2-p1)-atan(q2-q1);
double tb=ta+t;
P q0=p1-rot(q1-p0, t);
printf("%.10lf %.10lf %.10lf\n", q0.x, q0.y, tb/PI*180);
return 0;
}
chocorusk