結果

問題 No.1932 動く点 P / Moving Point P
ユーザー RhoRho
提出日時 2020-03-23 13:02:20
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,038 bytes
コンパイル時間 6,371 ms
コンパイル使用メモリ 92,376 KB
実行使用メモリ 7,576 KB
最終ジャッジ日時 2023-09-20 01:35:14
合計ジャッジ時間 20,364 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2,582 ms
7,576 KB
testcase_02 AC 513 ms
7,396 KB
testcase_03 AC 1,218 ms
4,380 KB
testcase_04 AC 3,584 ms
5,056 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target ("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target "tune=native"
#include<iostream>
#include<cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define MRE assert(0);
constexpr int inf = 1e9;
constexpr double pi = 3.1415926535897932;
constexpr int mod = 998244353;
double M[100006][2][3];
signed main() {
	cin.tie(0); ios::sync_with_stdio(false);
	int n; cin >> n;
	rep(i, n) {
		double p, q, theta; cin >> p >> q >> theta;
		theta = theta*pi / 180.0;
		M[i][0][0] = cos(theta);
		M[i][0][1] = -sin(theta);
		M[i][0][2] = q*sin(theta) - p*cos(theta) + p;
		M[i][1][0] = sin(theta);
		M[i][1][1] = cos(theta);
		M[i][1][2] = -p*sin(theta) - q*cos(theta) + q;
	}
	int q; cin >> q;
	rep(j, q) {
		int s, t; double x, y; cin >> s >> t >> x >> y;
		double nx, ny;
		for (int i = s - 1; i < t; i++) {
			nx = M[i][0][0] * x + M[i][0][1] * y + M[i][0][2];
			ny = M[i][1][0] * x + M[i][1][1] * y + M[i][1][2];
			x = nx; y = ny;
		}
		printf("%.13lf %.13lf\n", x,y);
	}
}
0